表格标签: <table>
''' border: 表格边框. cellpadding: 内边距 cellspacing: 外边距. 像素 百分比.(最好通过css来设置长宽) <tr>: table row <th>: table head cell <td>: table data cell rowspan: 单元格竖跨多少行 colspan: 单元格横跨多少列(即合并单元格) <thead> <tbody>(不常用): 为表格进行分区. '''
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <!--<meta http-equiv="content-type" charset="UTF-8">--> <meta name="keywords" content="table标签"> <meta name="description" content="study"> <meta http-equiv="Refresh" content="60;https://www.baidu.com"> <meta http-equiv="x-ua-compatible" content="IE=EmulateIE7"> <title>Title</title> <!--<link rel="stylesheet" href="css.css">--> <link rel="icon" href="https://www.baidu.com/favicon.ico"> <!--<script src="js.js"></script>--> </head> <body> <table border="5px" cellpadding="30px" cellspacing="10px"> <!--table表格标签,border为表格边框粗细,cellpadding为内边距,cellspacing为外边距--> <thead> <!--thead标签定义表头可不写--> <tr> <!--tr标签定义行--> <th colspan="2">姓名-性别</th> <!--th标签为表头内容,colspan属性为合并两列单元格--> <th>爱好</th> </tr> </thead> <tbody> <!--tbody标签定义表格内容可不写--> <tr> <td colspan="2">小明-男</td> <!--td标签为表格内容,colspan属性为合并两列单元格--> <td>篮球</td> </tr> <tr> <td>小红</td> <td rowspan="2">女</td> <!--td标签为表格内容,rowspan属性为合并两行单元格--> <td>唱歌</td> </tr> <tr> <td>小花</td> <td>跳舞</td> </tr> </tbody> </table> </body> </html>