HTML <th> rowspan 屬性
示例
一個跨越三行的表頭單元格的 HTML 表格
<table>
<tr>
<th>月份</th>
<th>儲蓄</th>
<th rowspan="3">假日儲蓄!</th>
</tr>
<tr>
<td>一月</td>
<td>$100</td>
</tr>
<tr>
<td>二月</td>
<td>$80</td>
</tr>
</table>
自己動手試一試 »
更多“自己嘗試”的例子見下文。
定義和用法
rowspan
屬性定義了表頭單元格應該跨越的行數。
瀏覽器支援
Attribute | |||||
---|---|---|---|---|---|
rowspan | 是 | 是 | 是 | 是 | 是 |
語法
<th rowspan="數字">
屬性值
值 | 描述 |
---|---|
數字 | 設定表頭單元格應跨越的行數。注意: rowspan="0" 會告訴瀏覽器跨越到表格部分(thead, tbody, 或 tfoot)的最後一行 |
更多示例
示例
使用 rowspan="0" (在 Chrome, Firefox 和 Opera 中有效)
<table>
<thead>
<tr>
<th>月份</th>
<th>儲蓄</th>
<th rowspan="3">假日儲蓄!</th>
</tr>
</thead>
<tbody>
<tr>
<td>一月</td>
<td>$100</td>
<td rowspan="0">$100</td>
</tr>
<tr>
<td>二月</td>
<td>$80</td>
</tr>
</tbody>
</table>
自己動手試一試 »
<th> 標籤