How to fix a table whose caption and summary are the same?

table-duplicate-name page

The issue

A screen reader can announce both a table’s <caption> and its summary attribute. When the two say the same thing, the user hears the same sentence twice before reaching the data, on every table built this way.

The cause is usually a template that fills both from the same field. The summary attribute is obsolete in HTML, so most tables don’t need it at all.

Scope

Every visible table with both a non-empty summary attribute and a <caption> as a direct child is checked. The two are compared with surrounding spaces removed and without regard to case. Tables with only one of the two aren’t checked.

How to check you have it

  • In probeo: the page reports table-duplicate-name, “Tables should not have the same summary and caption”, as minor. It is a best practice rule rather than a WCAG criterion.
  • By hand: search the source for summary= on <table> and compare it with the table’s <caption>.
  • With a tool: axe DevTools has a rule with the same name.

The fix

Remove the summary attribute and keep the <caption>.

If the table needs a longer explanation, such as how to read it, put it in text near the table and reference it with aria-describedby.

Done when: no table’s caption repeats its summary, and the check above comes back clean.

Do not

  • Do not fill summary and <caption> from the same field.
  • Do not add a new summary attribute; it is obsolete.
  • Do not move the caption into summary; the caption is visible and the summary isn’t.

FAQ

Is the summary attribute still valid HTML?

It is obsolete. Browsers may still expose it, which is why a duplicate is heard twice.

Does a slightly different summary pass?

It passes this check. If both say nearly the same thing, it is still repetition for the listener, so removing the summary is the better fix.

What if the caption is visually hidden?

A hidden caption still names the table for assistive technology. The duplicate is a problem either way.

Which product detects this

Probeo checks this on every page of your site as part of Site Clarity. This page explains one instance; the product tells you every page that has it.