Native ability to sort a <table>
Open
Nobody has claimed this yet.
needs-triage
WHATWG
- Dominant language
- MDX
- Stars
- 4.5k
- Forks
- 226
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 4
Description
Sorting a table is common functionality added to a table via JavaScript. It would be helpful to have this functionality natively added to tables.
Related material:
- https://www.w3.org/WAI/ARIA/apg/patterns/table/examples/sortable-table/
- https://blog.logrocket.com/creating-react-sortable-table/
- https://stackoverflow.com/questions/14267781/sorting-html-table-with-javascript
- https://javascript.info/task/sortable-table
- https://webdesign.tutsplus.com/how-to-create-a-sortable-html-table-with-javascript--cms-92993t
- https://github.hubspot.com/sortable/docs/welcome/
Possible solution: add an attribute to a of sortable="true" with a ::marker of up/down (like ) for un-sorted, ▼ for descending, and ▲ for ascending.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the proposed sortable="true" attribute on and review the linked WAI-ARIA sortable-table example and related material. Done would require an agreed native table-sorting behavior, including unsorted, ascending, and descending states and their markers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html, javascript
- Domain
- frontend, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100