Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Adding scope="col"
to table headers provides semantic meaning for screen readers and other Assistive Technology. See an example here: http://dev.w3.org/html5/alt-techniques/#hag21
Related issue for Views 7.x-3.x: #864006: Improve table semantics by adding scope or headers/id attributes
Comment | File | Size | Author |
---|---|---|---|
#11 | Screenshot from 2015-05-04 17:54:01.png | 55.03 KB | mgifford |
#10 | tables_generated_by-1831162-10.patch | 590 bytes | Valentine94 |
#1 | views-semantic-tables-1831162-1.patch | 666 bytes | dcmouyard |
Comments
Comment #1
dcmouyard CreditAttribution: dcmouyard commentedHere's the patch.
Comment #2
dawehnerI have no idea of accessiblity but #864006-43: Improve table semantics by adding scope or headers/id attributes also agrees with using that.
Just for sanity we might should wait on that issue until #1773832: Replace usage of drupal_attributes, refactor to use Attribute better is in.
Comment #3
mgifford+1
It's a great light weight option for simple tables like what Drupal produces. Will be excellent to have this in core.
I think that this will mean that all data tables on the admin side (users, watchdog, etc) will come with basic scope definitions too.
Comment #4
CBAgreed. Quick and valuable enhancement.
Comment #5
mgiffordthis is a quick and simple enhancement. don't think it needs any further discussion.
Comment #6
catchI ate some raw garlic then committed the patch. Thanks!
Comment #7
mgiffordYou'll be safe against vampires now! Thanks Catch.
Any reason not to back-port this?
Comment #8
dawehnerI don't see any reason not to.
Comment #9
dawehner.
Comment #10
Valentine94Backport for Drupal 7
Comment #11
mgiffordSimple patch. Looks good to me.
Comment #12
dawehnerThank you for the quick feedback. Committed and pushed to 7.x-3.x