Easy Tutorial
❮ Att Table Width Tag Progress ❯

HTML <colgroup> width Attribute

HTML <colgroup> Tag

Example

A <colgroup> element with a predefined width value of 200 pixels for the first column:


Browser Support

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


Definition and Usage

The width attribute specifies the width of the column group.

Typically, the space occupied by a column group is the space needed to display its content. The width attribute is used to set a predefined width for the column group.

Note: This attribute will be overridden by any width settings in <col> elements.


Syntax

Attribute Values

Value Description
pixels Sets the width in pixels (example: width="50").
% Sets the width as a percentage of the enclosing element (example: width="50%").
relative_length Distributes available pixels among parts. Part one is set to "1", part two is set to "2" (For example, if the table width is 100px, the first column group is 20px, and the second column group is 50%, then the remaining available pixels are 30px). Example: If the available pixels are 30px, then part one can be set to "1", and part two to "2", which will be interpreted as 10 and 20 pixels ("1" for part one, "2" for part two).

❮ Att Table Width Tag Progress ❯