HTML <th> rowspan 屬性

HTML th 標籤參考手冊 HTML <th> 標籤

實例

下麵的 HTML 表格中包含一個橫跨三行的表頭單元格:

<table border="1"> <tr> <th>Month</th> <th>Savings</th> <th rowspan="3">Savings for holiday!</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> <tr> <td>February</td> <td>$80</td> </tr> </table>


(更多實例見頁面底部)

流覽器支持

屬性
rowspan Yes Yes Yes Yes Yes

注意:只有 Firefox 和 Opera 支持 rowspan="0",該值有特殊的含義(請看下麵的"屬性值"表格)。


定義和用法

rowspan 屬性定義表頭單元格應該橫跨的行數。


HTML 4.01 與 HTML5之間的差異

無。


語法

<th rowspan="number">

屬性值

描述
number 規定表頭單元格應該橫跨的行數。注意: rowspan="0" 告知流覽器使單元格橫跨到表格組件中的最後一個行(thead、tbody 或 tfoot)。


實例

更多實例


該實例只適用於 Firefox 和 Opera 流覽器,實例演示了 rowspan="0" 的使用。


HTML th 標籤參考手冊 HTML <th> 標籤