HTML <col> widthAttribute
Example
Two <col> elements with predefined widths:
<table border="1"
width="100%">
<col width="100">
<col width="50">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</table>
<col width="100">
<col width="50">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</table>
Try it Yourself »
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the width attribute, but no browser supportsrelative_lengthvalue.
Definition and Usage
HTML5 no longer supports the <col> width attribute.
The width attribute specifies the width of the col element.
Usually, the space occupied by the col element is the space it needs to display its content. The width attribute is used to set a predefined width for the col element.
Note:This attribute overrides any width settings in the <colgroup> element.
Syntax
<col width="pixels|%|relative_length">
Attribute Values
| Value | Description |
|---|---|
| pixels | Sets the width value in pixels (example: width="50"). |
| percent | Sets the width value as a percentage of the enclosing element (example: width="50%"). |
| relative_length | Allocates the available pixels to each part. |
HTML <col> Tag Other Extensions