HTML <col> span属性
例
ここで、最初の2つの列の背景色は赤である必要があります。
<table>
<colgroup>
<col span="2" style="background-color:red">
<col style="background-color:yellow">
</colgroup>
<tr>
<th>ISBN</th>
<th>Title</th>
<th>Price</th>
</tr>
<tr>
<td>3476896</td>
<td>My first HTML</td>
<td>$53</td>
</tr>
</table>
定義と使用法
この
span
属性は、
<col>
要素がまたがる列の数を定義します。
ブラウザのサポート
Attribute | |||||
---|---|---|---|---|---|
span | Yes | Yes | Yes | Yes | Yes |
構文
<col span="number">
属性値
Value | Description |
---|---|
number | Sets the number of columns a <col> element should span |
❮HTML<col>タグ