Table accessibility issues
See original GitHub issueThere are a few issues with the aria roles on the current table implementation:
role="grid"
should be an attribute on the table element instead of the inner grid- all table rows (including the header row) should have
role="row"
even if they don’t have event handlers likeonRowClick
See aria documentation for more details. Elements with role="grid"
require descendants with role="row"
, and elements with role="rowheader"
require an ancestor with role="row"
which requires an ancestor with role="grid"
.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
The Trouble with Tables: A Brief Introduction - Level Access
When we test tables to see how successfully they have been tagged for accessibility, we find these common issues: Is This a Data...
Read more >Tables Tutorial | Web Accessibility Initiative (WAI) - W3C
Tables without structural markup to differentiate and properly link between header and data cells, create accessibility barriers. Relying on visual cues alone ...
Read more >Table accessibility failures - AccessibilityOz
Perhaps you need a comprehensive list of likely accessibility issues with tables ... The Tables section details 25 accessibility problems and how to...
Read more >Tables - Usability & Web Accessibility - Yale University
Tables · Layout Tables vs Data Tables · Use Headers and Scope · Use Table Captions · Avoid Complex Tables · Avoid Empty...
Read more >Table Techniques to Avoid | Web Accessibility
Inaccessible tables are often the result of making them too complex, for example by trying to accomplish too much with one table or...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Is there a way how to not add these attributes? You have it wrong and even if that was implemented correctly it’s not always what you want, which is our case.
Role grid must be sued only when it’s a data grid with implemented keyboard navigation. Using such roles without implementing the rest hurts the accessibility.
I strongly suggest removal of the role grid and I would like to know the motivation behind adding it. This is how to use it properly and believe me, that’s not what you wan’t in many cases. https://www.w3.org/TR/wai-aria-practices/examples/grid/dataGrids.html https://www.w3.org/TR/wai-aria-practices/examples/grid/dataGrids.html
Re: your comment about
Grid
having no role=“row” children, I believe elements with role=“grid” do require descendants with role=“row” or role=“rowgroup” because they are “Required Owned Elements”. I’ve been using the Accessibility Developer Tools chrome extension and the audit complains when there is only an element with role=“grid”.Thanks for the quick review and
role="rowgroup"
change!