Here, the first two columns should have a background color of red.
The span
attribute defines the number of columns a <col>
element should span.
<col span="number">
Value | Description |
---|---|
number | Sets the number of columns a <col> element should span |
Example:
HTML
<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>
<tr>
<td>5869207</td>
<td>My first CSS</td>
<td>$49</td>
</tr>
</table>
How to create HTML <col> Tag | HTML Tag |
What Type of Browsers will Support for HTML <col> Tag | HTML Tag |
Attributes for HTML <col> Tag | HTML Tag |
How to set Default CSS Settings for HTML <col> Tag | HTML Tag |
How to add HTML <col> span Attribute | HTML Tag |
Type: | Html |
Category: | Web Tutorial |
Sub Category: | HTML Tag |
Uploaded by: | Admin |