The <thead> Element
Technical Summary
thead represents the row group of column labels and related ancillary cells for its parent table. A table can have zero or one direct thead child. It comes after any caption and colgroup elements and before the table body, tfoot, and direct tr children.
thead is a row group, distinct from th, which represents a header cell. HTML-AAM maps native thead to the rowgroup role. Cell roles and header/data relationships follow separate rules involving th, td, scope, and headers.
Definition, placement, and content model
| Property | Specification | Conditions and scope |
|---|---|---|
| Meaning | Row group of column labels and ancillary cells | Distinct from the header or data semantics of each cell |
| Context | Child of table | After caption and colgroup; before the table body, tfoot, and direct tr children; at most one direct child |
| Content model | Zero or more tr and script-supporting elements | Each row may contain td or th cells |
| Start and end tags | Start tag is required | End tag may be omitted only when immediately followed by tbody or tfoot |
| DOM interface | HTMLTableSectionElement | Shared with tbody and tfoot |
| Specific attributes | None | Global attributes apply |
HTML conformance and parser recovery are separate questions. A parser constructing a DOM from malformed input does not make that input conforming HTML.
thead, th, and the table model
| Element | Structural role | Cell semantics |
|---|---|---|
thead | Row group in the heading section | The section alone does not make each cell a header cell |
th | Cell in a row | Header cell; scope and the header-assignment algorithm determine its associations |
tbody | Row group in the table body | A th inside it can serve as a row header |
td | Cell in a row | Data cell |
The HTML Standard's definition of thead allows ancillary non-header cells in addition to column-label rows. Do not infer header relationships from section membership alone; inspect the cell elements and table model.
Complex tables may involve th attributes scope, id, and headers, row and column groups, and cell spans. The section name thead alone does not determine every cell association or announcement order.
DOM constructed by the parser
<table id="schedule">
<tr><th scope="col">Day</th></tr>
</table>
// DOM constructed by the HTML parser
table#schedule
└─ tbody (inserted implicitly)
└─ tr
└─ th
In the table insertion mode, when a tr token occurs outside a permitted table section, the tree builder inserts an implied tbody and reprocesses the token. It does not infer thead from a th cell. For conforming authoring markup, make thead the explicit parent of heading rows.
HTMLTableSectionElement and table APIs
| Member | Result or behavior | Scope and boundary |
|---|---|---|
table.tHead | Returns the first direct thead child | Returns null when there is none |
table.createTHead() | Returns the first existing thead or a newly created section | A new section is inserted after caption and colgroup |
table.deleteTHead() | Removes the first direct thead child | Does nothing when there is none |
thead.rows | An HTMLCollection of direct tr children | Live collection; reflects row insertions and removals |
thead.insertRow() / deleteRow() | Insert or remove rows in the section | Indexes are relative to rows in this section |
const table = document.querySelector("table");
const head = table.tHead; // Existing thead, or null
const sameHead = table.createTHead(); // Returns the existing section if present
head.rows.length; // Number of tr elements in thead
table.rows is the row collection for the whole table; thead.rows is the collection for the header section. Their names are similar, but their scopes differ. createTHead() creates a section; it does not create th cells or row content.
Accessibility mapping
HTML-AAM maps native thead to the WAI-ARIA rowgroup role. This exposes the header row-group structure; it does not assign header-cell roles to the cells in that group. Header cells are distinguished using th and table rules involving attributes such as scope.
The AAM measurement on this page uses Chrome browser role and name queries. It is not itself the normative HTML-AAM mapping, a record from a platform API such as Windows UI Automation, or an assistive-technology speech observation.
Facts and evidence
Normative specification claims, AAM mappings, and implementation results from selected environments are recorded separately.
| Type | Fact | Conditions / scope | Status | Evidence |
|---|---|---|---|---|
| SPEC | At most one thead may be a table child; it follows caption/colgroup and precedes tbody, tfoot, and direct tr children. Its content model is tr and script-supporting elements. | Element definition, ordering, tag omission, and HTMLTableSectionElement interface. | Reviewed | HTML Standard: the thead element |
| SPEC | When a tr token is processed in the table insertion mode as a table child, the parser inserts tbody. It does not infer thead from a th cell. | Distinguishes parser construction/recovery from authoring conformance. | Reviewed | HTML Standard: in table insertion mode |
| SPEC | HTML-AAM maps native thead to the rowgroup role. | Distinguishes normative mapping from browser accessibility trees, platform APIs, and assistive-technology output. | Reviewed | HTML-AAM: thead |
Evidence
- HTML Standard: The
theadelement — context, content model, tag omission, and section interface - HTML Standard: The
tableelement — table child structure and APIs - HTML Standard: The “in table” insertion mode — implied tbody insertion and token reprocessing
- HTML Accessibility API Mappings:
thead— rowgroup mapping - Web Platform Tests:
the-thead-element/rows.html— section row collection - Web Platform Tests:
the-table-element/tHead.html— table.tHead behavior
Implementation evidence
Specification requirements, browser observations in selected environments, WPT runs, and accessibility role/name queries are recorded separately. Each result is limited to its stated fixture, browser, and test scope.
| Type | Reproducible scope | Recorded conditions | Status |
|---|---|---|---|
| IMPL | HTMLTableSectionElement, table.tHead, createTHead() / deleteTHead(), thead.rows / insertRow() / deleteRow(), parser handling of a direct tr, and an omitted end tag |
2026-10-17 JST / Chrome UA 155.0.0.0 (Windows NT 10.0 UA) / viewport 1920×911 / navigator.language=en-US. Served build-config/yugien/research-results/thead-v1/ at loopback 127.0.0.1:4198; fixture checks passed 14/14. Confirmed the section interface, table.tHead, createTHead() with an existing section and its insertion position, the row collection and row APIs, parser insertion of tbody for a direct tr, and permitted end-tag omission. One Chrome environment only; other browsers, OS builds, and platform APIs were not measured. |
Partial observation (Chrome 155 / fixture 14/14) |
| WPT | Selected WPTs for thead.rows and table.tHead / section APIs |
2026-10-17 JST / Chrome UA 155.0.0.0 / wpt.live. rows.html: 1/1 passed; tHead.html: 3/3 passed. Total: 4/4 passed. The exact upstream revision served by wpt.live could not be pinned. Unselected tests and other browsers were not run.The test version used was not recorded. The linked test may change, so this result cannot be repeated with certainty against the same version. |
4/4 selected tests passed (wpt.live revision not pinned) |
| AAM | Native table, row group, row, column header, row header, and data cell exposure through Chrome browser role/name queries | 2026-10-17 JST / Chrome UA 155.0.0.0 (Windows NT 10.0 UA) / viewport 1920×911 / navigator.language=en-US. Queried the fixture table named Quarterly revenue and observed 1 table, 3 row groups (thead, tbody, and tfoot), 4 rows, 2 column headers, 2 row headers, and 3 cells. This is a browser role-query observation; Windows UI Automation and screen-reader speech were not measured. |
Partial observation (Chrome 155 browser role query / one environment) |
Coverage and open issues
- SPECElement meaning, placement, content model, tag omission, DOM interface, table parsing, table APIs, and HTML-AAM role mapping reviewed
- IMPLLimited to the fixture and one Chrome environment. Other browsers, OS builds, and print behavior are unmeasured
- WPTSelected tests only. The upstream revision served by wpt.live is not pinned; other browsers and the full directory are unchecked
- AAMBrowser role/name queries measured. Platform accessibility APIs, assistive-technology speech, and cross-environment comparisons are untested
- ReviewExpert-gap Review has not been completed
This Topic has initial coverage. Passing the selected fixture and tests does not establish the same result for every HTML structure, browser, operating system, or assistive technology.
Related surfaces
Column-group rules and measurements are covered in the colgroup Topic; a beginner-friendly example is in How to Use the colgroup Element.
For a beginner-friendly example, see How to Use the thead Element in Yugien. The whole table model is covered in the table Topic; header cells and cell associations in the th Topic; body row groups in the tbody Topic; summary row groups in the tfoot Topic; and row structure in the tr Topic.