aria-sort should be allowed on multiple columns
aria-sort states "For each table or grid, authors should apply aria-sort to only one header at a time."
It is relatively common in large tables to allow multiple columns to be used in the sort criteria. Sort by column 1 then sort by column 2 etc. We should be able to use aria-sort for this.
See also: #582
Adding the "Agenda" label: I don't think this needs to be an ARIA 2.0 thing. Tables exist in the wild that have this functionality, and I don't believe it would be hard to support this in ATs or browsers.
@jnurthen found an example that uses shift-click to sort multiple columns: https://datatables.net/examples/basic_init/multi_col_sort.html

I don't think this is a particularly clear user interface—Of the sorted columns, which has priority?—but since it's being used in sites, I see no issue with allowing aria-sort on multiple elements.
Quick brainstorm: the "multi-column sort order/priority" problem might be solved as a new attribute aria-sortorder: null | 1 | 2 | n… or as a variant value on the existing attr, maybe: aria-sort="ascending second" or aria-sort="ascending 2"... Musing. Not thoroughly considered and no strong preference.
I don't think this is a particularly clear user interface—Of the sorted columns, which has priority?
In the applications I know, this is very clearly marked with numbers in the column headings
new attribute aria-sortorder or as a variant value on the existing attr, maybe: aria-sort="ascending second"
I would prefer the new attribute because the second variant differs greatly from the current ARIA standard (one attribute for two different value types: name and number)
In the applications I know, this is very clearly marked with numbers in the column headings
Screen shots and/or more specific references to those may help. I don't think I've ever seen any, and no one else on the call could think of examples that conveyed the order.
Screen shots and/or more specific references to those may help
I am not allowed to publish screenshots of internal company applications, but a google search for "table multiple sort" finds many examples, e.g. https://blog.ofanitguy.com/2014/03/06/ls2013-html-enhancing-table-control-with-column-sort-and-filters/
As a matter of fact, multiple sorts in tables are not rare in real life business applications.
@stes-acc do you want to take ownership of this?
Yes
I have a prototype of a table where more than one column can be sorted at a time. I have multiple clients whose data tables do this. I cannot share the client examples, but I can share the prototype, variants of which are in user-facing sites:
- Demo: https://cdpn.io/pen/debug/poexGPV
- Explainer: https://adrianroselli.com/2021/06/multi-column-sortable-table-experiment.html
Visually, it puts numbers on the column headings to indicate which column is sorted first, and then next, and so on.
Programmatically, since there is no way to indicate a ranking or priority, I append "priority #" to the accDesc for the column. It is a bit wordy, but seems to have so far gotten the point across.
In the attached screen shot, I am showing the Year column is sorted descended, and then Title is sorted ascending, and then Author is sorted descending.
On sort in this case, the live region announced (Year was already apparent from the control name): "sorted down, Author descending priority 3, Title ascending priority 2"
For the programmatic bits once it is in the state shown in the image:
- The accName of the Year column is "Year".
- Its accDesc is "sort priority 1"
- The button's accName is "Year".
- The button has no accDesc.
- This pattern applies to the other columns.
I am not saying this is the right way to handle it. It does show a representation of what is in the wild and identifies gaps in how it should convey ranking/priority.
Just a quick note as a library author to say that aria-sortorder would be easy to implement. I'm happy to prototype things in development versions of DataTables if any accessibility software devs are interested in trying things out.
@aardrian would you want to take this on by any chance?
@pkra
@aardrian would you want to take this on by any chance?
Yes.
Thursday 29 May 2025, we had a deep dive.
I made slides (should be accessible, and the embedded video has captions), and the slides include examples with my own approach (neither good nor bad, just an approach): ARIAWG-deep-dive_table-sort.pptx
I believe there is a recording of the call instead of minutes.
Broad agreement:
- ARIA does not forbid sorting on multiple columns.
- If exposed programmatically, a new property is preferred over adding a value to an existing property.
- The method for sorting is out scope of this issue (whether a button in the column header or a control outside the table).
Undecided:
- Whether or not ARIA needs to expose a sort priority.
- Or whether authors can do it sufficiently with text, accNames, other cues (with my caution against CSS generated content).
Next steps:
- Survey current support for announcing sort both when performing sort and when navigating column. My recent testing showed:
- NVDA, JAWS, Narrator, and VoiceOver/iPadOS support.
- TalkBack and VoiceOver on macOS do not support.
- Link to open bugs (and file if necessary)
- Find any related issues.
- Find out if screen reader vendors show any interest.
Related but out of scope:
- Wikipedia uses
Shiftto sort more than one column, but does not expose the priority in any way: https://en.wikipedia.org/wiki/Help:Sortable_tables#Secondary_key_and_multi-key_sorting - Open-UI discussed asking UAs to natively support sorting, but does not discuss sorting multiple columns and is also marked stale: https://github.com/openui/open-ui/issues/800