Wikipedia talk:Manual of Style/Accessibility/Data tables tutorial: Difference between revisions

Content deleted Content added
Dodoïste (talk | contribs)
Images and color: reply complete
 
(331 intermediate revisions by 47 users not shown)
Line 1:
{{skip to talk}}
== Unbulleted lists ==
{{page views}}
At the risk of increasing the number of templates in an article, there is a space-saving template called {{tl|Unbulleted list}} which might be useful when tables become wide. It produces the correct semantic markup for a list, which is exactly what is needed when a data cell contains a lower hierarchy of data (in this case a list). Here's an example:
{{talk header}}
{{WikiProject banner shell|
{{WikiProject Accessibility}}
}}
{{User:MiszaBot/config
| algo = old(250d)
| archive = Wikipedia talk:Manual of Style/Accessibility/Data tables tutorial/Archive %(counter)d
| counter = 2
| maxarchivesize = 150K
| archiveheader = {{Automatic archive navigator}}
| minthreadstoarchive = 1
| minthreadsleft = 4
}}
 
== MOS:COLHEAD potential workaround? ==
{|class="wikitable" border="1"
|+ List of albums
! scope="col" rowspan="2" width="100"| Title
! scope="col" rowspan="2" width="215"| Album details
! scope="col" colspan="10"| Peak chart positions
! scope="col" rowspan="2" width="145"| Sales
! scope="col" rowspan="2" width="125"| [[List of music recording certifications|Certifications]]
|-
! scope="col" style="width:2em;font-size:75%"| [[Billboard 200|US]]
! scope="col" style="width:2em;font-size:75%"| [[ARIA Charts|AUS]]
! scope="col" style="width:2em;font-size:75%"| [[Austria|AUT]]
! scope="col" style="width:2em;font-size:75%"| [[Finland|FIN]]
! scope="col" style="width:2em;font-size:75%"| [[Netherlands|NLD]]
! scope="col" style="width:2em;font-size:75%"| [[New Zealand|NZ]]
! scope="col" style="width:2em;font-size:75%"| [[Norway|NOR]]
! scope="col" style="width:2em;font-size:75%"| [[Sweden|SWE]]
! scope="col" style="width:2em;font-size:75%"| [[Switzerland|SWI]]
! scope="col" style="width:2em;font-size:75%"| [[UK Albums Chart|UK]]
|-
! scope="row" | ''[[Bleach (album)|Bleach]]''
|
*Released: June 15, 1989
*Label: [[Sub Pop]] <small>(SP #34)</small>
*Format: [[Compact disc|CD]], [[Compact cassette|cassette]], [[LP album|LP]]
|align="center"| 89
|align="center"| 34
|align="center"| 26
|align="center"| 24
|align="center"| —
|align="center"| 30
|align="center"| —
|align="center"| —
|align="center"| —
|align="center"| 33
| {{nowrap|1.7 million (US)}}
| {{nowrap|Platinum (US)}}
|-
! scope="row" | ''[[Nevermind]]''
|
*Released: September 24, 1991
*Label: [[DGC Records|DGC]] <small>(DGC #24425)</small>
*Format: CD, CS, LP
|align="center"| 1
|align="center"| 2
|align="center"| 2
|align="center"| 1
|align="center"| 5
|align="center"| 2
|align="center"| 2
|align="center"| 1
|align="center"| 2
|align="center"| 7
| {{nowrap|10 million(US)}}<br>{{nowrap|26 million (worldwide)}}
| {{nowrap|Diamond (US)}}<br />{{nowrap|2× Platinum (UK)}}
|}
 
would become:
 
{|class="wikitable" border="1"
|+ List of albums
! scope="col" rowspan="2" | Title
! scope="col" rowspan="2" | Album details
! scope="col" colspan="10"| Peak chart positions
! scope="col" rowspan="2" | Sales
! scope="col" rowspan="2" | [[List of music recording certifications|Certifications]]
|-
! scope="col" style="width:2em;font-size:75%"| [[Billboard 200|US]]
! scope="col" style="width:2em;font-size:75%"| [[ARIA Charts|AUS]]
! scope="col" style="width:2em;font-size:75%"| [[Austria|AUT]]
! scope="col" style="width:2em;font-size:75%"| [[Finland|FIN]]
! scope="col" style="width:2em;font-size:75%"| [[Netherlands|NLD]]
! scope="col" style="width:2em;font-size:75%"| [[New Zealand|NZ]]
! scope="col" style="width:2em;font-size:75%"| [[Norway|NOR]]
! scope="col" style="width:2em;font-size:75%"| [[Sweden|SWE]]
! scope="col" style="width:2em;font-size:75%"| [[Switzerland|SWI]]
! scope="col" style="width:2em;font-size:75%"| [[UK Albums Chart|UK]]
|-
! scope="row" | ''[[Bleach (album)|Bleach]]''
|{{Unbulleted list
|Released: June 15, 1989
|Label: [[Sub Pop]] <small>(SP #34)</small>
|Format: [[Compact disc|CD]], [[Compact cassette|cassette]], [[LP album|LP]]
}}
|style="text-align:center"| 89
|style="text-align:center"| 34
|style="text-align:center"| 26
|style="text-align:center"| 24
|style="text-align:center"| —
|style="text-align:center"| 30
|style="text-align:center"| —
|style="text-align:center"| —
|style="text-align:center"| —
|style="text-align:center"| 33
| {{nowrap|1.7 million (US)}}
| {{nowrap|Platinum (US)}}
|-
! scope="row" | ''[[Nevermind]]''
| {{Unbulleted list
|Released: September 24, 1991
|Label: [[DGC Records|DGC]] <small>(DGC #24425)</small>
|Format: CD, CS, LP
}}
|style="text-align:center"| 1
|style="text-align:center"| 2
|style="text-align:center"| 2
|style="text-align:center"| 1
|style="text-align:center"| 5
|style="text-align:center"| 2
|style="text-align:center"| 2
|style="text-align:center"| 1
|style="text-align:center"| 2
|style="text-align:center"| 7
| {{Unbulleted list
|{{nowrap|10 million (US)}}
|{{nowrap|26 million (worldwide)}}
}}
| {{Unbulleted list
|{{nowrap|Diamond (US)}}
|{{nowrap|2× Platinum (UK)}}
}}
|}
 
Can [[MOS:COLHEAD]] violation in [[Iga Świątek career statistics#Performance timelines|this case]] be worked around by adding "id=colX is empty. In row13 you can found...." or a hidden comment with a similar message to indicate to screen readers that more content can be found in the next row instead of rearranging the rows? [[User:Qwerty284651|Qwerty284651]] ([[User talk:Qwerty284651|talk]]) 23:55, 2 June 2024 (UTC)
This also removes some of the the superfluous column widths (if you ''must'' have them, use ems because you don't know the metrics of the client's browser font) as well as the deprecated <nowiki><br /></nowiki> tags that are being used to visually mimic a list. Also, style="text-align:center" is much better than setting a td to the deprecated align=center. As usual, this isn't compulsory, but it is much better practice. The extra whitespace indenting in the unbulleted lists is only there to help make the structure clearer. I don't expect every editor to cope with this sort of markup, but there's no reason why experienced editors can't improve this as they clean-up tables. --[[User:RexxS|RexxS]] ([[User talk:RexxS|talk]]) 14:47, 10 September 2010 (UTC)
:#I do agree about the widths. Widths do make the table look prettier. But they should be made of <code>em</code> rather than pixels. A good practice that I forgot to apply here. Thanks for reporting. :-)
:#I agree about <code>style="text-align:center"</code> as well.
:#Now I'm not sure about this particular use of unbuletted lists. Sure the principle is good and all. But I'm not sure it's worth the effort here. In the "Album details" column it saves a little space. And in "Sales" and "Certifications" column it can sometimes indicate a list of two items. It's a lot of code for a small change. However, [[The Prodigy discography]] contains a few examples where unbuletted lists would really be useful (lists of 4 to 7 items). It needs some more thoughts (and possibly feedback from users) on my opinion.
:Among tables, there are some far more urgent use of {{t|Flatlist}} (with another layout) in {{t|Navbox}} for example. I'd rather work on a large-scale important improvement on Navbox than a few lists here and there. Priorities, priorites. ;-) [[User:Dodoïste|Dodoïste]] ([[User talk:Dodoïste|talk]]) 04:35, 11 September 2010 (UTC)
 
:That whole table is messed up so trying to workaround one bad part of it, won't really "fix" it. Look at the "Career statistics" section, 5 of the 9 rows have cell content unrelated to the column headers. Separate the tables, make better column headers, remove bad usage of bold. Not everything needs to be in one giant table. [[User:Gonnym|Gonnym]] ([[User talk:Gonnym|talk]]) 06:30, 3 June 2024 (UTC)
== Avoiding more than two levels of headers ==
::@[[User:Gonnym|Gonnym]], I proposed an [[Wikipedia talk:WikiProject Tennis#Performance timeline|improved version]] (pinging those involved in creating the new design {{ping|Fyunck(click)|Unnamelessness}}) which passes MOS:COLHEAD in my project's community, but people are used to one design, prevalent in 100s of tennis BLPs. The new look meets accessibility criteria [[WCAG]] for screen reader users but offsets the sighted who are used to the old design...a balancing act.
::Maybe remove the rows and replace them with {{tlx|notes}} or {{tlx|efn}}? [[User:Qwerty284651|Qwerty284651]] ([[User talk:Qwerty284651|talk]]) 16:42, 3 June 2024 (UTC)
:::Yeah, not surprised. There are some places I'll never touch just because I don't want to deal with that type of editors. [[User:Gonnym|Gonnym]] ([[User talk:Gonnym|talk]]) 16:48, 3 June 2024 (UTC)
::::@[[User:Gonnym|Gonnym]], I get you. I am going to make a push in favor of the visually impaired. Hopefully, it sticks. The minority needs to be tended to as well not just the ones blessed with the gift to see. [[User:Qwerty284651|Qwerty284651]] ([[User talk:Qwerty284651|talk]]) 16:54, 3 June 2024 (UTC)
::That is something I originally proposed, but you know, some kinds of compromise have to take as this is Wikipedia. :) [[User:Unnamelessness|Unnamelessness]] ([[User talk:Unnamelessness|talk]]) 06:08, 4 June 2024 (UTC)
:::I know. It is the bitter sweet truth. You can't please everybody. [[User:Qwerty284651|Qwerty284651]] ([[User talk:Qwerty284651|talk]]) 10:21, 4 June 2024 (UTC)
 
== Cells on multiple rows ==
The table given as the good example could be improved by using row headers (in this case the distances). Remember, screen readers are capable of non-linear navigation, so the ability to announce the [column header][row header] before any cell value can be more effective when row headers are present, particularly on larger tables. --[[User:RexxS|RexxS]] ([[User talk:RexxS|talk]]) 15:05, 10 September 2010 (UTC)
:In theory I agree of course. In this particular case I was unsure the distance would made relevant row headers. But at a second thought – and after I saw more use cases – I think you are right. :-) [[User:Dodoïste|Dodoïste]] ([[User talk:Dodoïste|talk]]) 15:16, 10 September 2010 (UTC)
 
Hi, are the cells spanned on multiple rows accessible? E.g., [[DC Extended Universe#Films]]: the correct way is to split the "Zack Snyder" cell into two cells with the same date or are they just fine as they are? [[User:Redjedi23|Redjedi23]] ([[User talk:Redjedi23|talk]]) 14:43, 21 June 2024 (UTC)
== Images and color ==
:I state that because if I try to read the ''Batman v Superman'' row, the Apple VoiceOver skips the director's name [[User:Redjedi23|Redjedi23]] ([[User talk:Redjedi23|talk]]) 15:41, 21 June 2024 (UTC)
::They're fine as they are. VoiceOver isn't that good with this kind of thing. [[User:Graham87|Graham87]] ([[User talk:Graham87|talk]]) 15:51, 21 June 2024 (UTC)
:::@[[User:Graham87|Graham87]] I get the same result with NVDA [[User:Redjedi23|Redjedi23]] ([[User talk:Redjedi23|talk]]) 16:01, 21 June 2024 (UTC)
::::{{replyto|Redjedi23}} Same, but also those sorts of tables aren't meant to be read linearly ... they're supposed to be read with table navigation commands (control+alt+arrows in NVDA's case), which works as expected. [[User:Graham87|Graham87]] ([[User talk:Graham87|talk]]) 17:39, 21 June 2024 (UTC)
:::::But in this way the header column loses its meaning, right? [[User:Redjedi23|Redjedi23]] ([[User talk:Redjedi23|talk]]) 18:01, 21 June 2024 (UTC)
::::::Not really. Screen reader users will just get used to having a blank cell (with information hopefully about the row spans) and things will be fine. [[User:Graham87|Graham87]] ([[User talk:Graham87|talk]]) 18:16, 21 June 2024 (UTC)
 
==Colgroups and rowgroups==
Collapsible tables can also work without the faux header:
In [[Wikipedia:Manual of Style/Accessibility/Data tables tutorial#Complex tables]] it says "To clearly define relationships and avoid accessibility issues, use <code>! scope="colgroup" colspan="2" | </code> when a column header spans two columns and <code>! scope="rowgroup" rowspan="2" | </code> when a row header spans two rows..." Can a combination of those be used when a column spans multiple rows <code>scope="rowgroup" colspan="2"</code> and when a row spans multiple columns <code>scope="colgroup" rowspan="2"</code> in complex tables? [[User:Qwerty284651|Qwerty284651]] ([[User talk:Qwerty284651|talk]]) 12:00, 13 August 2024 (UTC)
 
== Better describe the problem of missing captions for screen reader users (SRUs)? ==
{| class="wikitable collapsible" border="1"
|+ Sorted by country alphabetically
! scope="col" style="width:8em;" | Country
! scope="col" | Purpose
! scope="col" style="width:1em;" | <abbr title="January">J<abbr>
! scope="col" style="width:1em;" | <abbr title="February">F<abbr>
! scope="col" style="width:1em;" | <abbr title="March">M<abbr>
! scope="col" style="width:1em;" | <abbr title="April">A<abbr>
! scope="col" style="width:1em;" | <abbr title="May">M<abbr>
! scope="col" style="width:1em;" | <abbr title="June">J<abbr>
! scope="col" style="width:1em;" | <abbr title="July">J<abbr>
! scope="col" style="width:1em;" | <abbr title="August">A<abbr>
! scope="col" style="width:1em;" | <abbr title="September">S<abbr>
! scope="col" style="width:1em;" | <abbr title="October">O<abbr>
! scope="col" style="width:1em;" | <abbr title="November">N<abbr>
! scope="col" style="width:1em;" | <abbr title="December">D<abbr>
! scope="col" style="width:1em;" | <abbr title="January">J<abbr>
! scope="col" style="width:1em;" | <abbr title="February">F<abbr>
! scope="col" style="width:1em;" | <abbr title="March">M<abbr>
! scope="col" style="width:1em;" | <abbr title="April">A<abbr>
! scope="col" style="width:1em;" | <abbr title="May">M<abbr>
! scope="col" style="width:1em;" | <abbr title="June">J<abbr>
! scope="col" style="width:1em;" | <abbr title="July">J<abbr>
! scope="col" style="width:1em;" | <abbr title="August">A<abbr>
! scope="col" style="width:1em;" | <abbr title="September">S<abbr>
! scope="col" style="width:1em;" | <abbr title="October">O<abbr>
! scope="col" style="width:1em;" | <abbr title="November">N<abbr>
! scope="col" style="width:1em;" | <abbr title="December">D<abbr>
|-
! scope="row" | [[Australia]]
|
|
|
|
|
|
|
| style="background: #ABCDEF;" | x
| style="background: #ABCDEF;" | x
| style="background: #ABCDEF;" | x
| style="background: #ABCDEF;" | x
| style="background: #ABCDEF;" | x
| style="background: #ABCDEF;" | x
| style="background: #ABCDEF;" | x
| style="background: #ABCDEF;" | x
| style="background: #ABCDEF;" | x
| style="background: #ABCDEF;" | x
| style="background: #ABCDEF;" | x
| style="background: #ABCDEF;" | x
|
|
|
|
|
|
|-
! scope="row" | [[Canada]]
|
|
|
|
| style="background: #ABCDEF;" | x
| style="background: #ABCDEF;" | x
| style="background: #ABCDEF;" | x
| style="background: #ABCDEF;" | x
| style="background: #ABCDEF;" | x
| style="background: #ABCDEF;" | x
| style="background: #ABCDEF;" | x
| style="background: #ABCDEF;" | x
| style="background: #ABCDEF;" | x
| style="background: #ABCDEF;" | x
| style="background: #ABCDEF;" | x
| style="background: #ABCDEF;" | x
|
|
|
|
|
|
|
|
|
|}
 
Do we need to expand on the issue of missing captions? I ask because '''so many data tables do not have a caption''', suggesting that editors are unaware of the problems caused where one is missing. For example, a SRU can call up a list of tables on a page, each labelled by their caption. Where the caption is missing, the table is announced along the lines of "6 columns, 20 rows" by [[VoiceOver]]. I suspect that other software says something similar. Unless the user is a mind-reader (!), this is no good at all. What do others think? What can we do? I do not want to spend my whole editing career adding captions to existing tables! [[User:CrazyBuilder|<span style="color: #db0000">Crazy</span><span style="color: #3c78b4">Builder</span>]] [[User talk:CrazyBuilder|talk]] 20:08, 7 October 2024 (UTC)
But some people may not find it as "pretty". --[[User:RexxS|RexxS]] ([[User talk:RexxS|talk]]) 16:27, 11 September 2010 (UTC)
:Interesting. So the script chooses the first header and add the "show/hide" button to it. It's a pity we can't choose the header on the far right. "Show/hide" buttons are always on the right. Usability-wise it would be better to have consistent types of contents. I wish the usability team would complete their [http://usability.wikimedia.org/wiki/Style_Guide Style Guide] and ask users to comply to it. It's a good practice on Web projects. For example, we decide that link are blue and underlined on mouseover and onfocus. This behavior should never change on Wikipedia: it becomes a rule. It should be kind of similar with collapsible content: the appearance and behavior should never change.
:The best solution would be to improve the script. So that it adds the "show/hide" button to the caption instead. It's a lot of work as every table using this collapsible script should be fixed (and probably manually). Still, it's definitely something we will have to do sooner or later. I believe it would be better to gain experience with other simpler tasks. And afterwards we should make a task force for this job. Regards, [[User:Dodoïste|Dodoïste]] ([[User talk:Dodoïste|talk]]) 01:20, 12 September 2010 (UTC)
:: If we could ensure every table had a caption, then it would be the perfect place for the show/hide trigger. One day, maybe ...
:: Incidentally, my links are whatever colour I want, as anyone can override most global style choices in their own ''/[skin name here].css'' file. For example, I like to be able to pick out recently visited pages on my watchlist, but I'm somewhat colour-blind between the default blue link and the default for a visited link, so I set
::* <code><nowiki>a:visited { color: #8800C0; }</nowiki></code>
:: Similarly, anyone can override default behaviour for classes, such as the class="external text" to change the style of external links only. Of course, all of this works as simply as that, only if we don't embed in-line styles in elements.
:: You've made a lot of progress with giving good accessibility advice here, and all of it will also be useful for those working on the usability project – good accessibility and good usability have a habit of going together. Cheers --[[User:RexxS|RexxS]] ([[User talk:RexxS|talk]]) 04:06, 12 September 2010 (UTC)
:::Yes, one can override most global choices in their own skin css file and it's a good thing. It's very important accessibility-wise. Users can select/add a style sheet directly in their browser and have it applied for all websites (or may even be able to have website-specific style sheets). The [http://www.w3.org/TR/CSS2/cascade.html#important-rules !important declaration] is made especially for this purpose: it overrides the website's style sheet and inline styles.
:::Still, the default appearance should not change. When users customize style sheets it's their responsibility and choice (and needs). The default appearance should be consistent nonetheless.
:::"I'm somewhat colour-blind between the default blue link and the default for a visited link": as many of us average users. The usability team received a lot of complaints about it. But strangely - especially for a usability team - they did not take this feedback into account. WTF?
:::Thanks. :-) I'm glad to be able to help. Yes, accessibility and usability projects should collaborate more. For example, the only solution to solve most of the contrast issue with colors in articles and templates is through usability. It's far too complicated for the average user to test color contrasts with the Color Contrast Analyzer and corresponding guidelines. It's easier to decide that "for usability reasons the colors used in Navbox should be ... (insert relevant choice here) and that rule should never change".
:::Also, did you notice how I make the navigation in this Wikiproject? I used two usability recommendations that are almost never used on Wikipedia: a [[breadcrumb]], links in the menu are organized in sub-menus that do not contain more than [[Seven plus or minus two]] items. How about we organize help pages like that? It would surely make it easier for newcomers. Regards, [[User:Dodoïste|Dodoïste]] ([[User talk:Dodoïste|talk]]) 16:01, 12 September 2010 (UTC)