其实从这三个词的翻译上,也可以知道他们的使用用途:
thead(表格头)tbody(表格主体)tfoot (表尾)
话不多说,先上效果图:
具体使用看见代码演示:
<html>
<head>
<style type="text/css"> /* 下方表格的css文件,也可以自己写到一个css文件里,这里只设置了颜色,你也可以设置其它。*/
thead {color:green}
tbody {color:blue;height:50px}
tfoot {color:red}
</style>
</head>
<body>
<table border="1">
<thead>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
</thead>
<tbody>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>Sum</td>
<td>$180</td>
</tr>
</tfoot>
</table>
</body>
</html>
路漫漫求修远兮,吾将上下而求索。