HTML <th> 标签的 rowspan 属性

HTML <th> 标签

实例

表格单元横跨两行的表格:

  1. <table border="1">
  2. <tr>
  3. <th>Company</th>
  4. <th>Address</th>
  5. <th rowspan="3">All the companies in USA</th>
  6. </tr>
  7. <tr>
  8. <td>Apple, Inc.</td>
  9. <td>1 Infinite Loop Cupertino, CA 95014</td>
  10. </tr>
  11. <tr>
  12. <td>Google, Inc.</td>
  13. <td>1600 Amphitheatre Parkway Mountain View, CA 94043</td>
  14. </tr>
  15. </table>

定义和用法

rowspan 属性规定表头单元格可横跨的行数。

浏览器支持

所以浏览器都支持 rowspan 属性。

没有浏览器支持 rowspan=”0”,这个值有特殊的意义。(参见属性值表格中的描述)

语法

  1. <th rowspan="value">

属性值

描述
number 设置表头单元格可横跨的行数。
注释:rowspan=”0” 指示浏览器横跨到表格部分的最后一行(thead、tbody 或者 tfoot)。