Easy Tutorial
❮ Att Img Height Av Prop Played ❯

HTML <col> Tag

Example

The <colgroup> and <col> tags set background colors for three columns in a table:


Browser Support

All major browsers support the <col> tag.


Tag Definition and Usage

The <col> tag specifies column properties for each column within a <colgroup> element.

By using the <col> tag, you can apply styles to entire columns without having to repeat the styles for each cell or each row.


Differences Between HTML 4.01 and HTML5

Most attributes from HTML 4.01 are no longer supported in HTML5.


Differences Between HTML and XHTML

In HTML, the <col> tag has no closing tag.

In XHTML, the <col> tag must be properly closed.


Attributes

Attribute Value Description
align left <br>right <br>center <br>justify <br>char Not supported in HTML5. Specifies the horizontal alignment of content associated with the <col> element.
char character Not supported in HTML5. Specifies the character to align the content associated with the <col> element.
charoff number Not supported in HTML5. Specifies the offset of the first alignment character.
span number Specifies the number of columns the <col> element should span.
valign top <br>middle <br>bottom <br>baseline Not supported in HTML5. Specifies the vertical alignment of content associated with the <col> element.
width %<br> pixels<br> relative_length Not supported in HTML5. Specifies the width of a <col> element.

Global Attributes

The <col> tag supports HTML's global attributes.


Event Attributes

The <col> tag supports HTML's event attributes.

❮ Att Img Height Av Prop Played ❯