Problem/Motivation
The Tablefield module renders structurally correct <th> elements in both <thead> (when "Display first row as a table header" is on) and <tbody> (when "Display first column as a table header" is on), but it omits the scope attribute. Without scope, assistive technology has no programmatic way to associate data cells with their headers in tables that have both column and row headers. This is a WCAG 2.1 SC 1.3.1 (Info and Relationships) failurehttps://www.w3.org/WAI/WCAG22/Techniques/html/H43
Steps to reproduce
A table with both row and column headers
Proposed resolution
The fix: add scope="col" to <thead> cells and scope="row" to row-header <th> cells in <tbody>. And ID and Header attribute tags to better convey the tabular data to screen readers.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork tablefield-3582410
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #5
nicholassComment #6
nicholassTested this patch on our site and seems to be working correctly and now have more ADA friendly complex tables.
Comment #7
nicholassComment #8
nicholassComment #9
nicholassThis doesn't fully satisfy my ADA scanner, need to add id and header attributes to complex tables :(
Comment #10
nicholassOk now this patch produces tables with headers and ID to make our accessibility scanner happy. We use #3128030 patch so its also compatible with that and with the stock way this module allows you to set headers (globally) so it shouldn't affect people who lack the #3128030 patch.
Example:
Comment #12
nicholassComment #13
nicholass