Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / HTML

abbr — an alternative table-header label

The `abbr` attribute gives a `th` cell an alternative label for references to the header without replacing its visible contents.

Version: HTML Living Standard

Syntax

<th scope="col" abbr="Time">Average response time</th>

Put abbr on th when a long heading needs a different name while referring to data cells. The value may be shorter, expanded, or simply reworded; it need not be an abbreviation.

It does not establish cell relationships. The table structure, scope, and where needed headers determine which header applies. It is also distinct from the abbr element for abbreviations in ordinary text. It is not a current authoring attribute for td.

The example preserves the visible heading “Average response time”, exposes “Time” through the abbr property, and associates the data cell using headers. It creates no tooltip. Whether the alternative label is used by a screen reader depends on the browser and assistive-technology combination.

Examples

<!doctype html><meta charset="utf-8">
<table><tr><th id="timing" scope="col" abbr="Time">Average response time</th></tr>
<tr><td id="value" headers="timing">42 ms</td></tr></table>
<output id="result"></output>
<script>
const heading = document.querySelector('th');
document.querySelector('#result').textContent =
  'visible=' + heading.textContent + '; alternative=' + heading.abbr +
  '; association=' + document.querySelector('td').headers;
</script>

Result

visible=Average response time; alternative=Time; association=timing

The test checks unchanged heading text, the alternative label, and the cell association. It does not test a screen reader’s spoken output.

Sources