The headers attribute on a <td> or <th> lists the id values of header cells that label that cell. The value is a space-separated list of unique ids. Assistive technologies use these links to announce the correct context for each cell.
For simple tables, scope on <th> is often enough. Prefer headers when cells have multiple labels—for example after rowspan / colspan or multi-level headers.
Baseline · Widely available.
Not deprecated and not experimental. Stable across modern browsers since about July 2015. Applies to table cells only.
Accessibility only — no visual change.
headers does not style the table. Ids must be unique, point to <th> cells in the same table, and never reference the cell itself.
Syntax
HTML Syntax
syntax.html
<td headers="header_idheader_id …">
Each header_id must match the id of a <th> in the same <table>. The same pattern works on <th> for nested headers.
Row headers need ids. A, B, and C each get an id so they can be referenced.
rowspan covers three rows. The ABC cell visually spans A, B, and C.
headers lists all three.headers="a b c" tells assistive tech which rows that span belongs to.
Prefer descriptive ids. Short letters are fine for demos; real pages should use clear names.
Edge Cases & Pitfalls
Broken associations usually come from wrong ids or overusing headers on simple tables.
ids
Ids must exist in the same table
Every token in headers must match a cell id in that table. Missing or out-of-table ids break the association.
unique
Document-wide unique ids
Duplicate ids make the wrong header match. Prefer prefixed ids when a page has several tables.
scope
Do not overuse on simple tables
For one header row and optional row headers, scope is usually enough. Extra headers markup adds noise and error risk.
self
Never reference the cell itself
A cell must not include its own id in headers. Tokens should only point to other header cells.
deprecated
axis is deprecated
Do not use the old axis attribute. Use id + headers (or scope) for modern tables.
Compatibility
Browser Support
headers is an HTML attribute for table cells in the browser. It is not a Node.js, Deno, or Bun API.
✓ Baseline · Widely available
headers
Widely available since about July 2015. Chrome, Firefox, Safari, Edge, and Opera support it. Screen-reader quality still depends on correct ids and valid table structure.
97%Global support (approx.)
Google ChromeAll
Full support
Mozilla FirefoxAll
Full support
Apple SafariAll
Full support
Microsoft EdgeAll
Full support
OperaAll
Full support
Samsung InternetAll
Full support
Internet ExplorerAll
Supported
headersWidely supported
Bottom line: Safe to use wherever you need explicit cell-to-header associations. Validate ids and test with a screen reader on complex tables.
Remember
Key Takeaways
Role: explicitly link a cell to one or more <th> ids for assistive tech.
Format: space-separated unique ids — not commas.
When: complex tables with multiple labels; use scope for simple ones.
Check: ids unique, same table, no self-reference.
One line:headers names which header cells label a cell — it does not change the look of the table.
Frequently Asked Questions
On a td or th cell, headers lists the id values of th cells that label it. Screen readers use those links to announce the right row and column context.
Only table cells: td and th. Each referenced header cell must be a th with a unique id in the same table.
Use scope on th for simple row or column tables. Use headers when a cell belongs to several headers—merged cells, multi-level headers, or layouts where scope alone is ambiguous.
Space-separated. Example: headers="north jan q1". Commas are incorrect for this attribute.
No. It is an accessibility association only. Layout and styling stay the same.
Use the HTMLTableCellElement.headers property: cell.headers = "id1 id2". It is a space-separated string of header ids.