CSS Portal

HTML abbr Attribute

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!

Description

The abbr attribute in HTML is used to specify a short form or an abbreviation for the content of a <th> (table header) element. This attribute is particularly useful when the table header contains long text or phrases and you want to provide a more concise version that represents the same information. For example, in a table displaying various statistics, a column header might read "Percentage of Market Share," which could be abbreviated as "PMS." By using the abbr attribute, you can make the table more accessible, especially for screen readers, as it helps them understand and communicate the content more efficiently. Here's how you might use it in context:

<table>
  <tr>
    <th abbr="PMS">Percentage of Market Share</th>
    <!-- Other headers -->
  </tr>
  <!-- Table rows and cells -->
</table>

In this example, screen readers and other assistive technologies can use the abbreviation "PMS" instead of the full text "Percentage of Market Share," making the information easier to comprehend and navigate for users relying on these technologies. This attribute is part of the efforts to make web content more accessible and user-friendly, adhering to web standards and best practices.

Syntax

<th abbr="text">

Values

  • textA short text string for the <th> tag.

Applies To

Example

<table border="1">
<tr>
<th attr="Name">Employee Name</th>
<th attr="Role">Employee Role</th>
</tr>
<tr>
<td>John Doe</td>
<td>Marketing</td>
</tr>
<tr>
<td>Jane Doe</td>
<td>Sales Manager</td>
</tr>
</table>

Browser Support

The following information will show you the current browser support for the HTML abbr attribute. Hover over a browser icon to see the version that first introduced support for this HTML attribute.

This attribute is supported by all modern browsers.
Desktop
Chrome
Edge
Firefox
Opera
Safari
Tablets & Mobile
Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-

Last updated by CSSPortal on: 28th March 2024

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!