HTML aria-sort ARIA Attribute
The aria-sort attribute tells assistive technology which column or row header a table is sorted by, and whether the sort is ascending or descending.
Description
The aria-sort attribute indicates that a table or grid is sorted by a column or row, and in which direction. It goes on the header cell: a <th>, or an element with the columnheader or rowheader role. Screen readers announce it, for example "Price, column header, sorted ascending".
Only put it on one header at a time, the one the table is currently sorted by, and update it when the sort changes. Leave it off the other headers rather than setting none on all of them. The values ascending and descending are the common ones; other is for a sort that is neither.
The attribute does not sort anything. To let users change the sort, place a <button> inside the header and announce the result if it isn't obvious.
Properties
- Type
- Widget
- Value
- token
- Default
none- Used with
columnheader,rowheader
Syntax
<th aria-sort="ascending | descending | none | other">
Values
- ascendingItems are sorted in ascending order by this column.
- descendingItems are sorted in descending order by this column.
- noneThe default: no sort is applied.
- otherA sort other than ascending or descending is applied.
Example
Browser Support
The following information will show you the current browser support for the aria-sort ARIA attribute. Hover over a browser icon to see the version that first introduced support for this ARIA attribute.
Desktop





Tablets & Mobile





