The <colgroup> Element
Technical summary
colgroup represents a group of one or more columns in its parent table. If the group has no child col elements, its span gives the number of columns. If it has child col elements, their spans give the column counts.
Column groups and columns take part in the table model and CSS presentation, but they do not create heading text or data cells. th and the header-assignment rules describe table headings. CSS column boxes also behave differently from ordinary element boxes.
Definition, placement, and content model
| Item | colgroup | col |
|---|---|---|
| Meaning | A column group in its parent table | One or more columns inside its parent colgroup |
| Placement | A table child, after caption and before thead, tbody, tfoot, or tr | A child of a colgroup that has no span attribute |
| Count | Zero or more per table | Zero or more per colgroup |
| Content model | With span: nothing. Without span: zero or more col or template elements | Nothing |
| End tag | May be omitted in defined contexts | No end tag; it is a void element |
| Element-specific attribute | span: number of columns when there are no child col elements | span: number of columns represented by this col |
| DOM interface | HTMLTableColElement. The reflected span value is in the range 1–1000 | |
Conforming HTML uses a positive integer from 1 to 1000 for span. When a colgroup has child col elements, those children define the columns, so the parent must not have span. The markup conformance rule is separate from how the DOM property handles an invalid value set by script.
span and column groups
There are two ways to describe a column group. Use colgroup span with no child col elements, or put col elements inside the group and set spans on those elements.
<!-- Method A: no child col; give the group a column count -->
<colgroup span="2"></colgroup>
<!-- Method B: give each child col a column count -->
<colgroup>
<col span="2">
<col>
</colgroup>
These are alternatives for different tables. In Method B, the first col represents two columns and the second represents one. The table model forms columns and column groups, then relates them to the slots occupied by row cells. A represented column does not, by itself, mean every slot in that column has a cell.
td colspan and col span do different jobs. The first says that one cell covers multiple columns. The second says how many columns the column element represents. Both affect table-grid formation and overlap checks.
Table model, parser, and DOM interface
colgroup is a direct child structure of table. In conforming content, it follows an optional caption and comes before thead and the table body. The HTML parser builds a DOM according to its table insertion modes. Parser recovery can insert elements into a tree; that does not make the input markup conforming.
Both colgroup and col use HTMLTableColElement. Its span IDL property is an unsigned long with a default of 1 and a reflected range of 1–1000. The interface does not define a dedicated collection API for all columns in a table.
const group = document.querySelector("colgroup");
const column = group.querySelector("col");
group instanceof HTMLTableColElement; // true
column instanceof HTMLTableColElement; // true
group.span; // 1 by default
column.span; // 1 by default
// The table's data cells are still descendants of rows,
// not descendants of colgroup or col.
CSS column boxes
HTML column elements do not contain table cells in the DOM. In the CSS table model, column and column-group boxes occupy separate layers, and only a limited set of properties applies to them. CSS 2.1 lists background, width, visibility, and border.
| Property | Conditions and effect |
|---|---|
background | The column or group background shows through only when the cell and row backgrounds are transparent |
width | Acts as a minimum width for a column; it does not always force an exact width |
border | Participates in border conflict resolution when the table has border-collapse: collapse |
visibility | collapse affects column visibility and table sizing. Its interaction with spanning cells requires separate testing |
A CSS selector cannot select cells as descendants of colgroup. A column can receive some styles, such as a background, but column elements cannot control every property on text, padding, or cell borders. Browser implementation coverage here is limited to the stated fixture and WPT runs.
.highlighted-columns {
background-color: #eaf3ff;
}
<colgroup span="2" class="highlighted-columns"></colgroup>
Header relationships and accessibility mappings
colgroup represents column structure; it does not provide heading text or create cell-to-header relationships. Use table cells with th and, as appropriate to the structure, scope or headers to describe headings. Use scope="colgroup" only when the header cell is anchored in a matching column group.
The HTML-AAM Editor's Draft does not map col to an ARIA role or to the listed platform APIs. colgroup has no computed role; the document lists ROLE_SYSTEM_GROUPING for MSAA + IAccessible2 and Group (localized control type colgroup) for UIA. It lists no mapping for ATK or Apple AX.
A specification mapping, a browser's exposed accessibility tree, an operating-system API, and screen-reader speech are separate evidence. The AAM observation below is a Chrome browser accessibility-tree query; it is not a direct measurement of a platform API or assistive technology.
Facts and evidence
Normative specification claims, CSS conditions, and AAM mappings are tied to their evidence. Observations and unmeasured scope are recorded separately below.
| Type | Fact | Conditions / scope | Status | Evidence |
|---|---|---|---|---|
| SPEC | colgroup represents a column group in its parent table and follows caption before the header and body rows. | Table content model, colgroup context, and each element's content model | Reviewed | HTML Standard: colgroup / table |
| SPEC | With no child col elements, colgroup span gives the column count; otherwise child col spans give the counts. Conforming span values are 1–1000. | Markup conformance is distinct from the DOM property's behavior when script sets a value | Reviewed | HTML Standard: colgroup / col |
| SPEC | colgroup and col take part in the table model, but cells are DOM descendants of rows, not column elements. | Column slots, column groups, and cell-grid formation | Reviewed | HTML Standard: forming a table |
| SPEC | CSS 2.1 applies background, width, visibility, and border to columns and column groups; background and border have additional conditions. | CSS 2.1 table columns and table layers / transparency | Reviewed | CSS 2.1: columns |
| SPEC | HTML-AAM does not map col; colgroup has no computed role, and its platform mappings differ. | Individual element mappings in the HTML-AAM Editor's Draft | Reviewed | HTML-AAM: col / colgroup |
Evidence
- HTML Standard: The
colgroupelement — meaning, context, content model, tag omission, span, and DOM interface - HTML Standard: The
colelement — context, empty content model, span, and table model - HTML Standard: The
tableelement — permitted child order - HTML Standard: Forming a table — column groups, columns, slots, and cell spans
- HTML Standard: The “in table” insertion mode — parser handling of table children
- CSS 2.1: Columns — properties that apply to column and column-group boxes
- HTML-AAM:
colgroupandcol— platform-specific role mappings - Web Platform Tests:
col-span-limits.html— selected span reflection and table-layout checks - Web Platform Tests:
colgroup-col.html— tentative CSS table column and group width checks
Implementation evidence
Browser implementation, selected WPTs, and accessibility-tree queries are recorded separately. Each result is limited to its stated environment, fixture, and test scope.
| Type | Reproducible scope | Recorded conditions | Status |
|---|---|---|---|
| IMPL | The HTMLTableColElement interface for colgroup / col, default and reflected span values, table child order and parser recovery, column-group background, and accessibility-tree exposure |
2026-10-18 JST / Chrome UA 155.0.0.0 (Windows NT 10.0 UA) / viewport 1536×695 / DPR 1.25 / navigator.language=en-US. Served build-config/yugien/research-results/colgroup-v1/ at loopback 127.0.0.1:4200; fixture checks passed 21/21. Checked the interface, default span and script-setter range, table child order, parser insertion of a colgroup for a table-level col, that row cells are not children of column elements, computed background rgb(234, 243, 255), and its visible rendering. Details: docs/atlas/colgroup-evidence-2026-10-18.md. One Chrome environment only. |
Partial observation (Chrome 155 / fixture 21/21) |
| WPT | Selected WPTs for col / colgroup span limits and column-group / column widths |
2026-10-18 JST / Chrome UA 155.0.0.0 / wpt.live. col-span-limits.html: 3/5 passed, 2 failed. Script and markup span clamping passed. Column-width assertions were expected 53 / actual 51, and expected 51 / actual 50. colgroup-col.html (tentative): 4/6 passed, 2 failed. For 0% columns, table widths were expected 106 / actual 105, and expected 107 / actual 106. Total: 7/11 passed, 4 failed. Harness status was OK for both tests. The exact upstream revision served by wpt.live could not be pinned. See docs/atlas/colgroup-evidence-2026-10-18.md for results and scope.The test version used was not recorded. The linked test may change, so this result cannot be repeated with certainty against the same version. |
Partial observation (7/11 selected WPT assertions passed; 4 failed; revision unpinned) |
| AAM | Exposure of a named table, rows, cells, column groups, and columns in the Chrome browser accessibility tree | 2026-10-18 JST / Chrome UA 155.0.0.0 (Windows NT 10.0 UA) / viewport 1536×695 / DPR 1.25 / navigator.language=en-US. For the fixture's named table Quarterly plan prices, the accessibility tree showed 1 table, 3 rows, and 9 cells. Neither colgroup nor col appeared as a separate node; the returned tree labeled header cells as cell as well. This was a Chrome browser accessibility-tree query only. Windows UI Automation / IAccessible2 and other platform APIs, and screen-reader speech were not measured. |
Partial observation (Chrome 155 browser accessibility tree / one environment) |
Coverage and open issues
- SPECMeaning, placement, content models, span, DOM interface, table model, CSS 2.1 column properties, and HTML-AAM mappings
- IMPLSelected observations in one Chrome fixture and environment. Other browsers, OS builds, print, and complex rowspan/colspan grids are unmeasured
- WPTSelected tests only. The wpt.live revision, full test directories, and other browsers were not checked
- AAMChrome browser accessibility-tree query only. Windows UI Automation, IAccessible2, ATK, Apple AX, and assistive-technology speech were not measured
- ReviewExpert-gap Review has not been completed
This Topic has initial coverage. Passing the selected fixture and WPTs does not establish identical behavior across all HTML structures, browsers, operating systems, CSS implementations, or assistive technologies.
Related surfaces
For beginner-friendly examples, see How to Use the colgroup Element and How to Use the col Element in Yugien. The column element is covered in the col Topic, the whole table structure in the table Topic, header rows in the thead Topic, header-cell relationships in the th Topic, and summary row groups in the tfoot Topic.