HTML col span properties
Examples
Here, the first two columns background color to red:
<table border="1">
<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>
<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>
try it"
Browser Support
All major browsers support span property.
Definition and Usage
span attribute specifies the number of columns the col element should span.
Differences between HTML 4.01 and HTML5
NONE.
grammar
<col span="number">
Property Value
值 | 描述 |
---|---|
number | 设置 col 元素应该横跨的列数。 |
HTML <col> tag