Name

col — HTML 4.01 | HTML5

Synopsis

HTML: <col>; XHTML: <col/> or <col />

Establishes a column (or columns via the span attribute) within a table so that attribute properties may be applied to all the cells in the column(s). The col element does not group columns structurally (that is handled by the colgroup element) but rather is an empty element that allows attributes to be shared. The col element must appear after the caption element and before any row (tr) or row group (thead, tbody, tfoot) elements with the table element.

Start/End Tags

This is an empty element. In HTML, the end tag is forbidden. In XHTML, the element must be closed with a trailing slash as just shown. Developers may include a space character before the slash for backward compatibility with older browsers.

Attributes

Core, Internationalization, Events, HTML5 Global Attributes

align="left|right|center|justify|char"

Not in HTML5. Specifies the horizontal alignment of text in a cell or cells. The default value is left.

char="character"

Not in HTML5. Specifies a character along which the cell contents will be aligned when align is set to char. The default character is a decimal point (language-appropriate). This attribute is generally not supported by current browsers.

charoff="length"

Not in HTML5. Specifies the offset distance to the first alignment character on each line. If a line doesn’t use an alignment character, it should be horizontally shifted to end at the alignment position. This attribute is generally not supported ...

Get HTML & XHTML Pocket Reference, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.