👀 Live Preview
A data table with a modern <caption> (recommended approach):
| Quarter | Sales |
|---|---|
| Q1 | $10,000 |
| Q2 | $15,000 |
Use caption instead of the obsolete summary attribute for new tables.

The summary attribute in HTML was used to provide a text description of a <table> element—mainly for accessibility so screen readers could convey the table’s purpose and structure to users with visual impairments.
It is important to know that the summary attribute is obsolete in modern HTML. Do not use it in new projects. Instead, use <caption>, clear header cells, and ARIA techniques described in this guide.
Not the same as <summary>: The <summary> element inside <details> is a visible clickable heading—that is a tag, not this attribute.
Only element.
String value.
Legacy HTML.
Modern fix.
aria-describedby.
Legacy code.
summaryThe main purpose of the summary attribute was to offer a textual description of a table’s content and structure. Assistive technologies could read this description before navigating the cells, helping users understand context.
Modern HTML practices replace this with the <caption> element (visible or visually hidden), descriptive <th> headers, and when needed, aria-describedby linking to explanatory paragraph text.
The WHATWG HTML specification lists summary on table as obsolete. Browsers may still parse it, but screen readers often ignore it. Use modern table accessibility patterns instead.
Add summary to a <table> with a descriptive string:
<table summary="Description of this table.">
<thead>...</thead>
<tbody>...</tbody>
</table><table> (not on <details> or other elements).<caption> for new work.HTMLTableElement.summary (also obsolete).<summary> element used in disclosure widgets.The summary attribute accepts any string value that describes the table. The text should be concise yet informative:
summary="Quarterly sales figures for 2023." — Purpose of the data.summary="Employee contact list sorted by department." — Structure hint.summary="Comparison of monthly expenses vs revenue." — Relationship between columns.<table summary="This table lists the quarterly sales figures for the year 2023.">
<thead>
<tr><th>Quarter</th><th>Sales</th></tr>
</thead>
<tbody>...</tbody>
</table>| Topic | Detail | Example |
|---|---|---|
| Element | <table> only | Data tables |
| Value | Plain text string | "Sales by quarter" |
| Status | Obsolete | Do not use in new sites |
| Replacement | <caption> | Visible table title |
| Extra context | aria-describedby | Link to paragraph id |
| JavaScript | table.summary | Legacy maintenance |
| Element | Supported? | Notes |
|---|---|---|
<table> | Yes (defined) | Only element with summary attribute |
<summary> | No (different feature) | Element inside details, not an attribute |
<details> | No | Uses child summary element |
<div>, <section> | No | Not valid targets |
summary vs caption vs aria-describedby| Approach | Pros | Cons |
|---|---|---|
summary attribute | Simple on legacy pages | Obsolete; unreliable today |
<caption> | Standard, supported, can be styled | One caption per table |
aria-describedby | Links to longer explanation | Requires id on description element |
| Visible intro paragraph | Helps all users, not just AT | Must be placed near table logically |
Legacy summary on a sales table, dynamic JavaScript update, and the modern caption replacement.
A data table with a modern <caption> (recommended approach):
| Quarter | Sales |
|---|---|
| Q1 | $10,000 |
| Q2 | $15,000 |
Use caption instead of the obsolete summary attribute for new tables.
Legacy syntax (for understanding old code only):
<table summary="This table lists the quarterly sales figures for the year 2023.">
<thead>
<tr>
<th>Quarter</th>
<th>Sales</th>
</tr>
</thead>
<tbody>
<tr><td>Q1</td><td>$10,000</td></tr>
<tr><td>Q2</td><td>$15,000</td></tr>
<tr><td>Q3</td><td>$20,000</td></tr>
<tr><td>Q4</td><td>$25,000</td></tr>
</tbody>
</table>In this example, the summary attribute provides a brief description of the table’s contents. Historically, some screen readers announced it before reading cells; today you should use <caption> instead.
Set or update summary in legacy systems with JavaScript:
<table id="salesTable">
<thead>...</thead>
<tbody>...</tbody>
</table>
<script>
document.getElementById("salesTable").setAttribute(
"summary",
"Dynamically added summary describing the sales table."
);
</script>In this script, the summary attribute is dynamically set on the table with id salesTable. You can also use table.summary = "...", but modern accessibility tools may still ignore it.
The recommended pattern for accessible tables today:
<p id="sales-desc">
Figures are in USD. Totals exclude tax.
</p>
<table aria-describedby="sales-desc">
<caption>Quarterly sales figures for 2023</caption>
<thead>
<tr><th>Quarter</th><th>Sales</th></tr>
</thead>
<tbody>...</tbody>
</table><caption> names the table for everyone. aria-describedby connects optional extra context. This replaces what authors once tried to achieve with the obsolete summary attribute.
summary in new tables — It is obsolete and inconsistently supported by assistive technologies.<caption> — Provides a proper accessible name for the table.<th scope> — Mark row and column headers so screen readers understand relationships.aria-describedby when needed — For longer notes about data sources or units.summary string.
Legacy flow.
Before cells.
Modern standard.
Browsers still parse the summary attribute on tables, but it is obsolete and not reliably exposed to assistive technology. Treat it as legacy documentation only.
Parsed by browsers; largely ignored by modern accessibility APIs.
Bottom line: Learn it for legacy code; use caption and ARIA for accessible tables today.
<caption> for every data table<th scope="col"> or scope="row"aria-describedby for extra table notessummary when maintaining old sitessummary to new tablessummary with the <summary> elementth headersWhile the summary attribute was designed to improve table accessibility, it has been deprecated in modern HTML. Use <caption>, semantic headers, and ARIA attributes to ensure your tables are understandable to all users.
Understanding legacy summary is still valuable when maintaining or updating older websites, and it clarifies why modern standards moved description into visible, structured elements.
summaryBookmark these when working with HTML tables.
One element
ScopeString value
FormatDeprecated
StatusReplacement
ModernDifferent tag
Clarifydetails uses a child <summary> element, not this attribute.caption and proper table headers instead.<caption>, <th scope>, and optionally aria-describedby.setAttribute or table.summary, but prefer migrating to caption.Try the caption + aria-describedby pattern that replaces obsolete summary.
5 people found this page helpful