reactjs / react-a11y

Identifies accessibility issues in your React.js elements
MIT License
2.34k stars 126 forks source link

Rule for tables should have header cells #165

Closed kevee closed 5 years ago

kevee commented 5 years ago

A rule to test that tables have at least one th element. This rule could be improved with better heuristics (counting columns vs. number of header cells), but there's lots of possible edge cases for structuring data tables.

This rule fails if:

erin-doyle commented 5 years ago

I'm finally getting around to looking at this (sorry for the delay!) and I'm not sure I agree with requiring all tables to have th elements. I'm fairly certain there are ways to make tables and their headings accessible without necessarily using th elements, so this seems a little overly strict. I'd suggest instead perhaps writing this as a plugin vs making part of the core. There are instructions here on how to write a plugin: https://github.com/reactjs/react-a11y/blob/master/docs/plugins.md.