Latest web development tutorials

HTML col width attribute

HTML col tag Reference Manual HTML <col> tag

Examples

Having a predefined width of two <col> element:

<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>

try it"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support width property, but no browser supportsrelative_lengthvalue.


Definition and Usage

HTML5 is no longer supported <col> width attribute.

col width attribute specifies the width of the element.

Typically, col element of the space occupied by the contents of display space that it needs. width property is used to set up predefined width col element.

Note: This property overrides <colgroup> element any width settings.


grammar

<col width="pixels|%|relative_length">

Property Value

value description
pixels Setting the width in pixels (example: width = "50").
percent Set the width as a percentage of the element surrounded meter (example: width = "50%").
relative_length Assigned to each of the available pixel section.


HTML col tag Reference Manual HTML <col> tag