Wikipedia:Manual of Style/Accessibility/Data tables tutorial: Difference between revisions
Content deleted Content added
Jroberson108 (talk | contribs) m →Complex tables: Simplify a little more. |
Jroberson108 (talk | contribs) m →Complex tables: Simplify. |
||
Line 275:
When a column header spans two columns, use <code>! scope="colgroup" colspan="2" | </code>. When a row header spans two rows, use <code>! scope="rowgroup" rowspan="2"| </code>.<ref name="H63" group="WCAG"/>
For tables with headers that are more complex, it is recommended to simplify the table or split it up into smaller tables. When this isn't possible, you have to associate each cell to their respective header(s) using the "'''id'''" and "'''headers'''" attributes instead of "'''scope'''". On the headers, set the "id" to an un-spaced value that is unique within its table. On the cells that are described by headers, set the "headers" to a spaced list of the describing "id" values in an order that a screen reader should read them.<ref name="H43" group="WCAG">[https://www.w3.org/TR/2008/NOTE-WCAG20-TECHS-20081211/H43.html "H43: Using id and headers attributes to associate data cells with header cells in data tables"], accessibility level: A</ref> For example, the following
Below is an example of a complex table with headers that aren't visually clear. Look at the source code of this section to see how each cell's "'''id'''" and "'''headers'''" are defined.
|