HTML summary Attribute

Beginner
⏱️ 5 min read
📚 Updated: Jun 2026
🎯 3 Examples
Tables & Accessibility

Introduction

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.

What You’ll Learn

01

<table>

Only element.

02

Text desc

String value.

03

Obsolete

Legacy HTML.

04

caption

Modern fix.

05

ARIA

aria-describedby.

06

JavaScript

Legacy code.

Purpose of summary

The 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.

💡
Obsolete in HTML5

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.

📝 Syntax

Add summary to a <table> with a descriptive string:

summary.html
<table summary="Description of this table.">
  <thead>...</thead>
  <tbody>...</tbody>
</table>

Syntax Rules

  • Valid only on <table> (not on <details> or other elements).
  • Value is a plain text string describing the table.
  • Obsolete — prefer <caption> for new work.
  • Not rendered visually in browsers (intended for assistive tech).
  • IDL property: HTMLTableElement.summary (also obsolete).
  • Do not confuse with the <summary> element used in disclosure widgets.

💎 Values

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.
summary-values.html
<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>

⚡ Quick Reference

TopicDetailExample
Element<table> onlyData tables
ValuePlain text string"Sales by quarter"
StatusObsoleteDo not use in new sites
Replacement<caption>Visible table title
Extra contextaria-describedbyLink to paragraph id
JavaScripttable.summaryLegacy maintenance

Applicable Elements

ElementSupported?Notes
<table>Yes (defined)Only element with summary attribute
<summary>No (different feature)Element inside details, not an attribute
<details>NoUses child summary element
<div>, <section>NoNot valid targets

summary vs caption vs aria-describedby

ApproachProsCons
summary attributeSimple on legacy pagesObsolete; unreliable today
<caption>Standard, supported, can be styledOne caption per table
aria-describedbyLinks to longer explanationRequires id on description element
Visible intro paragraphHelps all users, not just ATMust be placed near table logically

Examples Gallery

Legacy summary on a sales table, dynamic JavaScript update, and the modern caption replacement.

👀 Live Preview

A data table with a modern <caption> (recommended approach):

Quarterly sales figures for 2023
QuarterSales
Q1$10,000
Q2$15,000

Use caption instead of the obsolete summary attribute for new tables.

Example — table with summary

Legacy syntax (for understanding old code only):

index.html
<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>
Try It Yourself

How It Works

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.

Dynamic Values with JavaScript

Set or update summary in legacy systems with JavaScript:

dynamic-summary.html
<table id="salesTable">
  <thead>...</thead>
  <tbody>...</tbody>
</table>

<script>
  document.getElementById("salesTable").setAttribute(
    "summary",
    "Dynamically added summary describing the sales table."
  );
</script>

How It Works

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.

Example — modern replacement with caption

The recommended pattern for accessible tables today:

caption-table.html
<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>

How It Works

<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.

♿ Accessibility

  • Do not use summary in new tables — It is obsolete and inconsistently supported by assistive technologies.
  • Always use <caption> — Provides a proper accessible name for the table.
  • Use <th scope> — Mark row and column headers so screen readers understand relationships.
  • Add aria-describedby when needed — For longer notes about data sources or units.
  • Test with screen readers — NVDA, JAWS, or VoiceOver confirm tables are understandable.

🧠 How summary Worked

1

Author adds text

summary string.

HTML
2

AT reads table

Legacy flow.

A11y
3

User hears context

Before cells.

Intent
=

Use caption now

Modern standard.

Browser Support

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.

Obsolete · Not recommended

Legacy attribute

Parsed by browsers; largely ignored by modern accessibility APIs.

<10% Effective AT support
Google Chrome Parses only
Obsolete
Mozilla Firefox Parses only
Obsolete
Apple Safari Parses only
Obsolete
Microsoft Edge Parses only
Obsolete
summary attribute Obsolete

Bottom line: Learn it for legacy code; use caption and ARIA for accessible tables today.

💡 Best Practices

✅ Do

  • Use <caption> for every data table
  • Mark headers with <th scope="col"> or scope="row"
  • Use aria-describedby for extra table notes
  • Document legacy summary when maintaining old sites
  • Test tables with real screen readers

❌ Don’t

  • Add summary to new tables
  • Confuse table summary with the <summary> element
  • Rely on summary instead of proper th headers
  • Hide all context from sighted users (caption helps everyone)
  • Use layout tables for data without accessibility structure

Conclusion

While 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.

Key Takeaways

Knowledge Unlocked

Five truths every developer should know about summary

Bookmark these when working with HTML tables.

5
Core concepts
📝 02

Text desc

String value

Format
03

Obsolete

Deprecated

Status
📄 04

caption

Replacement

Modern
05

Not details

Different tag

Clarify

❓ Frequently Asked Questions

It was meant to describe a table’s purpose and structure for assistive technologies.
No. details uses a child <summary> element, not this attribute.
No. It is obsolete. Use caption and proper table headers instead.
<caption>, <th scope>, and optionally aria-describedby.
Yes via setAttribute or table.summary, but prefer migrating to caption.
To read and update legacy HTML tables that still contain the attribute.

Build accessible tables the modern way

Try the caption + aria-describedby pattern that replaces obsolete summary.

Try modern caption pattern →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful