table-duplicate-name
Rule Severity : Minor
Description
The table-duplicate-name rule ensures that a table’s <caption> element and its summary attribute (a legacy HTML4 attribute still encountered in existing markup) do not contain the same text. The <caption> is a visible title for the table displayed on screen, while summary was intended to describe the table’s structure and purpose for screen reader users. When they contain identical text, screen reader users hear the same information twice: first from the summary and again from the caption, which is repetitive and unhelpful.
This rule meets WCAG requirements by:
- Conveying Information and Relationships (WCAG 1.3.1 Info and Relationships): It ensures that each piece of table metadata serves a distinct informational purpose, so the structure and relationships within the table are conveyed without unnecessary repetition.
To comply with this rule, make the caption a concise visible title and, if a summary attribute is present, ensure it provides additional context about the table’s structure, such as how rows and columns are organised, rather than repeating the caption.
Examples
Here, the summary attribute and the <caption> element contain identical text. Screen readers announce the same phrase twice: once from the summary and once from the visible caption.
This corrected example gives the <caption> a brief visible title while the summary (if retained) provides structural guidance that is distinct from the caption.
How to fix?
To fix violations of the table-duplicate-name rule, follow these steps:
-
Ensure the
<caption>element provides a brief, descriptive title for the table that is visible to all users. -
If a
summaryattribute is present, change its content to describe the table’s structure, such as how to interpret rows and columns or how to navigate a complex table, rather than repeating the caption text. -
Note that the
summaryattribute is deprecated in HTML5. For new markup, consider using a<details>element adjacent to the table, or a description paragraph before or after the table, instead of thesummaryattribute.
Reference
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!