HTML summary Attribute

The obsolete HTML summary attribute was historically used on the <table> element to provide a text description of the table's structure, organization, or purpose, particularly to help users of non-visual browsers understand complex tables.

Historical Syntax

The summary attribute was placed on the <table> element and contained a text description of the table.

<table summary="Monthly sales totals for each product category.">
  ...
</table>

The summary was not normally displayed as visible page content. It was intended to provide additional information that could help users understand the table.

Historical Elements

The obsolete summary attribute was associated with the <table> element.

Element Historical Purpose
<table> Provided a description of the table's purpose, structure, or organization.

Historical Use

The summary attribute was intended to provide information that could make a table easier to understand without relying only on its visual layout. This could be especially useful for complicated tables containing several rows, columns, or groups of related data.

<table summary="The first column lists plants. The remaining columns show recommended planting months for three growing regions.">
  ...
</table>

The summary could explain how information was organized or how the table should be read. Unlike a visible table caption, the attribute's text was not normally presented to all users as part of the page.

Why It Became Obsolete

The summary attribute placed potentially useful information in an attribute that was not normally visible to everyone. Modern HTML encourages authors to provide useful descriptions and explanations in content that can be available to all users.

Tables should also use semantic table markup so relationships between headings and data can be determined from the table itself. This includes appropriate use of <caption>, <th>, and the scope attribute where needed.

Modern Alternative

There is no single attribute that directly replaces summary. Use a combination of visible explanatory text and properly structured table markup according to the complexity of the table.

Historical HTML

<table summary="Monthly vegetable harvest totals by garden.">
  ...
</table>

Modern HTML

<table>
  <caption>Monthly Vegetable Harvest Totals by Garden</caption>
  <thead>
    <tr>
      <th scope="col">Garden</th>
      <th scope="col">June</th>
      <th scope="col">July</th>
      <th scope="col">August</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th scope="row">North Garden</th>
      <td>18 lbs.</td>
      <td>26 lbs.</td>
      <td>31 lbs.</td>
    </tr>
    <tr>
      <th scope="row">South Garden</th>
      <td>15 lbs.</td>
      <td>24 lbs.</td>
      <td>29 lbs.</td>
    </tr>
  </tbody>
</table>

The <caption> provides a visible title or description for the table, while <th> elements identify row and column headings. The scope attribute can clarify whether a header applies to a row or column.

If a complex table needs additional explanation, place that explanation in normal page content near the table so it is available to everyone.

Legacy Browser Support

The summary attribute appeared in older HTML specifications and may still be encountered in legacy table markup.

Modern webpages should not depend on the attribute for table accessibility. Use semantic table structure and provide important descriptions in content that users can access directly.

For additional information about historical browser compatibility, visit Can I Use? . Search for the HTML element or attribute you want to check. Search results can include related HTML features, element attributes, APIs, and other technologies, so select the result that most closely matches the legacy feature you are researching.

Other attributes associated with table structure or older table presentation include:

  • scope - Identifies the cells for which a table header provides heading information.
  • headers - Associates a table data cell or header cell with one or more header cells in more complex tables.
  • axis - An obsolete attribute historically used to categorize table cells.
  • rules - An obsolete attribute historically used to control dividing lines within tables.
  • frame - An obsolete attribute historically used to control borders around a table.

Specifications

The summary attribute on the <table> element is obsolete and must not be used by authors. Authors should describe table structure and purpose using appropriate table markup and explanatory text when needed. See the WHATWG HTML Living Standard for information about obsolete and non-conforming features.