Name
colgroup — HTML 4.01 | HTML5
Synopsis
<colgroup> . . . </colgroup>
Defines a conceptual group of columns that form a structural
division within a table. The colgroup
element must appear after the
caption
element and before any row
(tr
) or row group (thead
, tbody
, tfoot
) elements with the table
element.
A table may include more than one column group. The number of
columns in a group is specified either by the value of the span
attribute or by a tally of column
(col
) elements within the group.
Column groups may be useful in speeding table display (for example,
the columns can be displayed incrementally without waiting for the
entire contents of the table) and provide a system for display on
nonvisual display agents such as speech- and Braille-based
browsers.
Start/End Tags
HTML 4.01: Required/Optional; HTML5: Optional/Optional; XHTML: Required/Required
Attributes
Same attributes as col
element.
Example
See also table.
<table>
<colgroup id="employinfo">
<col span="2" width="100" />
<col span="1" width="50" class="date" />
</colgroup>
<thead> . . . (markup continues
)
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.