HTML <th> colspan属性
例
2つの列にまたがるヘッダーセルを持つHTMLテーブル:
<table>
<tr>
<th colspan="2">Monthly Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</table>
定義と使用法
このcolspan
属性は、ヘッダーセルがまたがる列の数を定義します。
ブラウザのサポート
Attribute | |||||
---|---|---|---|---|---|
colspan | Yes | Yes | Yes | Yes | Yes |
注: Firefoxのみがサポートしますcolspan="0"
。これには特別な意味があります(以下の「属性値」の表を参照してください)。
構文
<th colspan="number">
属性値
Value | Description |
---|---|
number | Sets the number of columns a header cell should span. Note: colspan="0" tells the browser to span the cell to the last column of the column group (colgroup) |
❮HTML<th>タグ