The Table Header & Scope Checker audits your HTML tables for the structure that makes them readable to assistive technology. A table that looks fine visually can be meaningless to a screen-reader user if the header cells and their relationships are not marked up correctly.
How it works
The tool parses your HTML and analyses each <table> it finds. For every table it reports on:
- Header cells — does the table contain any
thelements at all? A data table with none is a hard failure. - Scope — do the
thcells carryscope="col"orscope="row"? Missing scope is flagged as a recommendation, especially when both row and column headers exist. - Caption — is there a
<caption>giving the table a name? Recommended for all data tables. - Sections — are
thead/tbodypresent to separate header rows from body rows? - Layout detection — a table with no
thand no caption is flagged as a probable layout table. - Complex tables —
thcells withcolspan/rowspanare flagged so you can verifyid/headersassociations manually.
This maps to WCAG 1.3.1 (Info and Relationships).
Example
<table>
<tr><th scope="col">Month</th><th scope="col">Revenue</th></tr>
<tr><th scope="row">January</th><td>£4,200</td></tr>
</table>
This passes the core checks: it has th header cells with scope, and each data cell is associated with both a column and a row header. Adding a <caption> would resolve the remaining recommendation.
Notes
- Use
thonly for genuine headers; do not style ordinarytdcells to look like headers. - For merged-cell tables, prefer the explicit
id+headerspattern overscope. - If a table is purely decorative layout, replace it with CSS grid or flexbox, or add
role="presentation".