Tables sharing a name, and tables with none
Several tables on one page need distinct names or a screen reader's table list is unusable. squirrel checks captions and labels.
What a table name is
Screen readers let users list the tables on a page and jump to one. That list shows each table’s accessible name, which comes from a <caption>, from aria-label, or from aria-labelledby.
With one table on the page the name is a convenience. With several it is the only thing distinguishing them, and two tables both called “Results” are the same entry twice.
What squirrel checks
Two check names, at rule severity warning and weight 3. The rule looks at tables that are not role="presentation" or role="none", and does nothing at all unless there is more than one: with none it returns info with No data tables found, and with exactly one it returns info with Only one table found.
A name is taken from aria-label, from aria-labelledby pointing at elements with text, or from a <caption>.
table-duplicate-namewarns withN duplicate table name(s) foundwhen two or more tables share a name, compared lowercased and trimmed. Items read"revenue by quarter" (2 tables), and the finding suggestsGive each table a unique caption or aria-label.tables-without-nameswarns withN table(s) without accessible names, notingAdd caption or aria-label to distinguish tables.table-duplicate-namepasses withAll tables have unique accessible nameswhen neither problem appears.
How to fix it
<table>
<caption>Revenue by quarter, 2025</caption>
...
</table>
<table>
<caption>Revenue by quarter, 2026</caption>
...
</table>A <caption> is the better of the two options because it is visible. Everyone gets the label, not only screen reader users, and it cannot drift out of sync with the heading above the table.
Where the design has no room for a caption, aria-label on the <table> does the job. Where a heading above the table already names it, point aria-labelledby at that heading’s id.
| Rule ID | a11y/table-duplicate-name |
| Category | Accessibility |
| Scope | Per-page |
| Severity | warning |
| Weight | 3/10 |
Enable / disable
Disable this rule
[rules]
disable = ["a11y/table-duplicate-name"]Disable all Accessibility rules
[rules]
disable = ["a11y/*"]Enable only this rule
[rules]
enable = ["a11y/table-duplicate-name"]enable replaces the default ["*"], so this is the only rule selected. Leave disable out: a rule that matches any disable pattern is skipped even when enable names it. Only an enabled setting under a rule’s own [rule_options] table overrides both lists.
Related rules
- a11y/table-headers: whether those tables have
<th>cells at all. - a11y/th-has-data-cells: headers with no data under them, usually a layout table.
- a11y/td-headers-attr: explicit header associations in complex tables.
- a11y/duplicate-id-aria: the
aria-labelledbyreference resolving correctly.
Accessibility findings ship in every audit next to the SEO, performance and agent experience rules. See Website security scan with AI for how an agent works through a report.
References
- Caption and summary, W3C WAI tutorials
- The caption element, MDN
- Understanding SC 1.3.1 Info and Relationships, W3C
Check your site
Run squirrel audit https://example.com and open the Accessibility section of the report. Duplicate names and missing names are reported as separate checks. Signed-out local audits need no account and cost nothing. Signed-in audits spend credits.