patternfly / patternfly-design

Use this repo to file all new feature or design change requests for the PatternFly project
114 stars 104 forks source link

Tables - how to handle tables with empty column headers/cells #1176

Closed nicolethoen closed 2 years ago

nicolethoen commented 2 years ago

Our automated accessibility tests are beginning to flag empty table headers - such as the above selectable columns with a checkbox, for example.

https://dequeuniversity.com/rules/axe/4.2/empty-table-header

175120368-994642e0-56eb-443c-93d9-de886479c0ae

There may be an accessible solution using aria attributes like aria-label or aria-labelledby. I wonder if we should consider a visible table header. Or in the case of table cells - a visual representation of 'no data'. It seems like there is quite a bit of debate on this topic online. It'd probably warrant a conversation with @jessiehuff and others

nicolethoen commented 2 years ago

Another possibility is to replace empty th cells with empty td cells since they don't cause the same axe warning. Maybe even a combination of aria-labels and td cells may work...

nicolethoen commented 1 year ago

https://dequeuniversity.com/rules/axe/4.7/empty-table-header

nicolethoen commented 1 year ago

Seems this w3 examples supports the use of td in lieu of th when necessary: https://www.w3.org/WAI/tutorials/tables/irregular/#table-with-two-tier-headers