Table Headers
Table headers are the labels that identify what the rows or columns of a data table represent, such as a column titled "Date" or a row labeled "Total." They help users understand how the information in a table is organized and which data belongs to which category. This is especially important for people using assistive technology like screen readers, which rely on properly marked headers to explain the relationships between cells.
Table headers are cells that describe the meaning of associated data cells in an HTML data table, typically marked up using the <th> element rather than <td>. The <th> element defines a cell as the header of a group of table cells and, per HTML semantics, can be associated with data cells so assistive technologies can convey the correct relationships. For simple tables, the scope attribute (for example scope="col" or scope="row") indicates whether a header applies to a column or a row. More complex structures may require additional techniques: tables with header cells spanning multiple columns or rows (irregular headers) can use attributes such as colspan, rowspan, and the headers/id association mechanism, and multi-level headers use subheadings to describe successive sections of a table. Marking headers programmatically, rather than relying on visual styling alone, is generally necessary for the structure to be exposed to users of assistive technology.
Why it matters
Table headers establish the relationships that make tabular data understandable. When a screen reader encounters a data cell in a properly marked-up table, it can announce the associated header, telling the user, for example, that a given value belongs to the "Total" row and the "March" column. Without programmatically defined headers, a table often reduces to a stream of disconnected values, and the meaning that sighted users infer from visual alignment and styling is lost to people using assistive technology.
This matters most for complex data. Tables with headers that span multiple columns or rows, or that use subheadings to describe successive sections, can be especially difficult to interpret when the structure is not conveyed programmatically. As recognized authorities such as the W3C note, subheadings that describe what the next section of a table is about can be unclear when they are not marked as headers. Relying on visual styling alone, bold text, background color, or position, does not expose these relationships to screen readers.
Proper table markup contributes to WCAG-aligned outcomes related to information, structure, and relationships being programmatically determinable, though this guidance is not legal advice. Meeting a specific technique does not by itself guarantee an accessible experience or legal compliance, and manual and assistive technology testing are generally needed to confirm that a table's relationships are conveyed as intended.
Who it's relevant to
Inside Table Headers
Common questions
Answers to the questions practitioners most commonly ask about Table Headers.