HTML <colgroup> span 屬性
示例
使用 <colgroup> span 屬性設定前兩列的背景顏色
<table>
<colgroup span="2" style="background:red"></colgroup>
<tr>
<th>ISBN</th>
<th>標題</th>
<th>價格</th>
</tr>
<tr>
<td>3476896</td>
<td>我的第一個 HTML</td>
<td>$53</td>
</tr>
<tr>
<td>5869207</td>
<td>我的第一個 CSS</td>
<td>$49</td>
</tr>
</table>
自己動手試一試 »
定義和用法
span
屬性定義了 <colgroup>
元素應該跨越的列數。
提示:要在 <colgroup>
中的列定義不同的屬性,請使用 <col>
標籤在 <colgroup>
標籤內。
瀏覽器支援
Attribute | |||||
---|---|---|---|---|---|
span | 是 | 是 | 是 | 是 | 是 |
語法
<colgroup span="數字">
屬性值
值 | 描述 |
---|---|
數字 | 設定列組應跨越的列數 |
❮ HTML <colgroup> 標籤