HTML 表格头部、主体、页脚

2024-01-05 13:45 小编

 表格可以分为三个部分 - 头部,主体和页脚,如同word 文档中页面的页眉、正文、页脚。每个页面保持相同,而正文是表格的主要内容持有者。

 头部,主体和页脚的对应的三个标签是:

  • <thead> - 创建单独的表头。
  • <tbody> - 表示表格的主体。
  • <tfoot> - 创建一个单独的表页脚。

 表可以包含多个<tbody>元素以指示不同的页面。

 但值得注意的是<thead><tfoot>标签应出现在<tbody>之前:

<table border = "1" width = "100%">

<thead>

<tr>

<td colspan = "4">This is the head of the table</td>

</tr>

</thead>       

<tfoot>

<tr>

<td colspan = "4">This is the foot of the table</td>

</tr>

</tfoot>     

<tbody>

<tr>

<td>Cell 1</td>

<td>Cell 2</td>

<td>Cell 3</td>

<td>Cell 4</td>

</tr>

</tbody>         

</table>


在线咨询 拨打电话

电话

13363039260

微信二维码

微信二维码