Accessible Tables, Headers and Captions
How th, scope, caption and headers let a screen reader announce which row and column a cell belongs to, and how to check a table's accessible structure.
Accessible Tables, Headers and Captions
The player loads from youtube-nocookie.com when you press play. Nothing reaches YouTube before that.
Not started
What you'll learn
- A screen reader user moves through a table cell by cell and hears the row and column headers as they go. That only works if the headers are real `<th>` cells; bold text in a `<td>` is not a header.
- `scope="col"` and `scope="row"` say which direction a `<th>` labels. For simple tables with headers along the top and down the left, that is all you need.
- A `<caption>` names the table. In tests, Chromium and Firefox both exposed a captioned table with the caption as its name.
- Tables with more than one level of headers, or headers that do not line up in a grid, need explicit links: give each header an `id` and list those ids in each cell's `headers` attribute. Prefer restructuring into simpler tables.
- Empty cells hide information from screen reader users. Put visible text such as a dash or `N/A` in a cell that has no value.
What a table sounds like
Sighted users read a table by glancing across and down. They hold the header in view while their eyes land on a cell. A screen reader user cannot glance. They move one cell at a time with keyboard commands, and the screen reader has to say enough about each cell for them to know where they are.
When the markup is right, moving into the cell under “Sales” in the “North” row can announce something like “North, Sales, 4”. That announcement comes from the browser’s accessibility tree, which records which header cells belong to which data cells. When the markup is wrong, the user hears only “4” and has to count columns in their head.
Everything in this lesson is a way of putting that header relationship into the markup.
Real headers: <th>
A header is a <th> element. Not a bold <td>, not a <td> with a class called header. The difference is semantic: a <th> is exposed to assistive technology as a header, and a <td> is exposed as an ordinary cell.
You can see this directly. In a test I made two tables with the same text, one with <th> and the other with <td> in the header row, and read the accessibility tree through Playwright’s ariaSnapshot. The <th> version listed columnheader "Region" and columnheader "Sales". The <td> version listed cell "Region" and cell "Sales". That held in Chromium and Firefox, and the <th> result also held in WebKit. This does not prove what a particular screen reader says, but it shows what the browser hands over.
Direction: scope
A <th> can label a column or a row. scope says which:
<table>
<caption>Q3 sales by region</caption>
<thead>
<tr><th scope="col">Region</th><th scope="col">Sales</th></tr>
</thead>
<tbody>
<tr><th scope="row">North</th><td>4</td></tr>
<tr><th scope="row">South</th><td>5</td></tr>
</tbody>
</table>
The test above also showed rowheader "North" for the scope="row" cells. Browsers can often guess a header’s direction without scope, but guessing breaks on tables with a header in the corner or in unusual positions, so setting it is cheap insurance. Use scope="col" for headers along the top and scope="row" for headers down the side.
Naming the table: <caption>
A <caption> is the table’s title, and it must be the first child of <table>. In the same test, the accessibility tree listed a captioned table as table "Q3 sales" (the caption text), which means the caption became the table’s name. Screen readers typically announce a table’s name and its size when you reach it, which lets a user decide to enter it or skip it.
Keep the caption short and specific. “Q3 sales by region” is useful; “Table 1” is not. If you want a longer note about how to read the table, put it in a paragraph and link it with aria-describedby; the accessible names and descriptions lesson covers how that works.
When scope is not enough: id and headers
Some tables have two levels of column headers, such as “2025” spanning “Q1” and “Q2” beneath it. A cell then needs to say that it belongs to both. scope cannot express that, so HTML has a second mechanism. Give each header an id, and list the ids on each data cell:
<th id="y25" colspan="2">2025</th>
<th id="q1">Q1</th><th id="q2">Q2</th>
...
<td headers="y25 q1">12</td>
It works, and it is also easy to get wrong, because you maintain the links by hand. The first thing to try is simplifying: two small tables, each with simple headers, are usually better for everyone than one table with merged header cells. Complex tables covers the cases where you cannot.
Layout tables and empty cells
If you are stuck with a table that is used for layout, role="presentation" removes its table semantics. In a test, a table with that role showed in the accessibility tree as plain text, not a table. That is a last resort, since the real fix is to use CSS layout.
For data tables, empty cells are a problem of their own. A screen reader announces nothing for an empty cell, so a user cannot tell a deliberately empty cell from a missed one. Put visible text in it: a dash, N/A or “none”.
Checking your work
Open the accessibility panel in your browser’s developer tools and look at the table. A good structure has columnheader and rowheader entries in the right places. Then try a real screen reader: VoiceOver on macOS, NVDA on Windows. The testing HTML accessibility lesson covers the workflow. Automated checkers will catch a missing <th> or a missing caption, but not whether the headers are the right ones.
What the video covers
The embed is a clip, 0:00 to 4:22, from AccessibilityChecker’s “What is an Accessible Data Table? Headers, Scope and Captions Explained” (October 2026). Its chapter list covers why table accessibility is about the code, why headers matter, layout tables versus data tables, th, scope and caption, complex tables with ids and headers, the WCAG 1.3.1 requirement and common mistakes. The clip ends before the chapters on testing and scanning a full site, where, from the title, the video moves on to the channel’s own scanner, which is why I cut it. AccessibilityChecker is a vendor channel, so the pitch is likely, and it is a young channel (the video is weeks old at the time of writing). I could not read a transcript. The runner-up is a three-minute VoiceOver demo that lets you hear the difference, and the Roselli talk is an hour of detail from one of the best-known authorities on the subject. The accessibility-tree results above are mine and were checked in a browser, not a screen reader.
Where this fits
This builds on table structure. The naming ideas return in accessible names and descriptions, and the accessibility tree lesson explains what the browser is exposing. The next lesson, complex tables, covers merged cells and column groups.
Check yourself
A designer makes the header row of a table out of `<td>` cells with `font-weight: bold`. Why does that fail for screen reader users?
Bold is only a visual cue. The accessibility tree reports those cells as plain cells, so nothing tells the software they label the column below. Use `<th>` so the cells are exposed as column headers.
What does `scope="row"` on a `<th>` in the first column do?
It states that the header labels the rest of its row. When a user lands on a cell in that row, the screen reader can announce the row header as well as the column header. In a test the accessibility tree reported these cells as `rowheader` and the top cells as `columnheader`.
When do you need the `headers` attribute?
When a cell is described by more than one header in a way that `scope` cannot express, such as tables with two levels of column headers or merged header cells. Give each header an `id` and put the ids of all relevant headers in the cell's `headers`. Where you can, split such a table into simpler ones instead.
A cell has no value. What should it contain, and why?
Visible text, such as an en dash or `N/A`. An empty cell gives a screen reader user nothing to hear, so they cannot tell if the cell is empty or if the screen reader missed it.
Go deeper
Notes
Notes are saved to your account.
Everything else on this page works without one — progress and bookmarks keep themselves in this browser and come with you when you sign in. Notes are the one thing worth not trusting to a browser you might clear.
Your notes could not be loaded.