Easy Tutorial
❮ Ref Country Codes Att Td Colspan ❯

HTML <col> width Attribute

HTML <col> Tag

Example

Two <col> elements with predefined widths:


Browser Support

All major browsers support the width attribute, but no browser supports the relative_length value.


Definition and Usage

The width attribute specifies the width of the <col> element.

Typically, the space taken by a <col> element is the space needed 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

Attribute Values

Value Description
pixels Sets the width in pixels (example: width="50").
percent Sets the width as a percentage of the enclosing element (example: width="50%").
relative_length Distributes the available pixels among the parts.
❮ Ref Country Codes Att Td Colspan ❯