Acerca de esta regla de accesibilidad
Screen readers announce both the <caption> and summary when a user encounters a data table. The <caption> element serves as the table’s visible, on-screen title — it tells all users what the table is about. The summary attribute (available in HTML4 and XHTML, though deprecated in HTML5) is read only by screen readers and is intended to describe the table’s structure, such as how rows and columns are organized. When these two contain the same text, the screen reader simply reads the same content twice, which provides no additional value and creates a confusing, redundant experience.
This issue primarily affects blind and deafblind users who rely on screen readers to navigate and interpret tabular data. Screen readers have specialized table navigation features, but they depend on accurate, meaningful markup to function properly. When the caption and summary are duplicated, users lose the opportunity to get both a concise title and a helpful structural description of the table.
This rule is identified as a Deque best practice and is also referenced in the RGAA (French government accessibility standard). While it doesn’t map directly to a specific WCAG success criterion, it supports the principles behind WCAG 1.3.1 Info and Relationships (Level A), which requires that information and structure conveyed visually are also available programmatically.
How to Fix It
The fix is straightforward: make sure the <caption> and summary attribute contain different text that each serves its intended purpose.
-
Use the
<caption>element to give the table a concise, visible title that describes what data the table contains. -
Use the
summaryattribute to describe the table’s structure — for example, how many column groups there are, what the row and column headers represent, or how the data is organized.
If you find you can’t think of distinct content for both, consider whether you actually need the summary attribute at all. For simple tables, a <caption> alone is often sufficient. Note that summary is deprecated in HTML5, so for modern documents you may want to provide structural descriptions using other techniques, such as a paragraph linked with aria-describedby.
Examples
Incorrect: Identical Caption and Summary
The summary and <caption> contain the same text, causing screen readers to repeat the information.
<table summary="Quarterly sales figures">
<caption>Quarterly sales figures</caption>
<tr>
<th>Quarter</th>
<th>Revenue</th>
</tr>
<tr>
<td>Q1</td>
<td>$50,000</td>
</tr>
<tr>
<td>Q2</td>
<td>$62,000</td>
</tr>
</table>
Correct: Caption and Summary Provide Different Information
The <caption> names the table, while the summary describes its structure.
<table summary="Column 1 lists each quarter, column 2 shows total revenue for that quarter.">
<caption>Quarterly sales figures</caption>
<tr>
<th>Quarter</th>
<th>Revenue</th>
</tr>
<tr>
<td>Q1</td>
<td>$50,000</td>
</tr>
<tr>
<td>Q2</td>
<td>$62,000</td>
</tr>
</table>
Correct: Using Only a Caption (HTML5 Approach)
For simple tables in HTML5, you can skip the deprecated summary attribute entirely and rely on a <caption> alone.
<table>
<caption>Quarterly sales figures</caption>
<tr>
<th>Quarter</th>
<th>Revenue</th>
</tr>
<tr>
<td>Q1</td>
<td>$50,000</td>
</tr>
<tr>
<td>Q2</td>
<td>$62,000</td>
</tr>
</table>
Correct: HTML5 Alternative Using aria-describedby
If you need to provide a structural description in HTML5, use aria-describedby to link to a nearby paragraph instead of using summary.
<p id="table-desc">Column 1 lists each quarter, column 2 shows total revenue for that quarter.</p>
<table aria-describedby="table-desc">
<caption>Quarterly sales figures</caption>
<tr>
<th>Quarter</th>
<th>Revenue</th>
</tr>
<tr>
<td>Q1</td>
<td>$50,000</td>
</tr>
<tr>
<td>Q2</td>
<td>$62,000</td>
</tr>
</table>
Learn more:
Ayúdanos a mejorar nuestras guías
Detecta problemas de accesibilidad automáticamente
Rocket Validator escanea miles de páginas con Axe Core y el W3C Validator, encontrando problemas de accesibilidad en todo tu sitio web.