W3C home > Mailing lists > Public > w3c-wai-ig@w3.org > April to June 2018

Re: accessible tables

From: Userite <richard@userite.com>
Date: Sun, 6 May 2018 22:24:52 +0100
Message-ID: <8901BEA9B06941ADBBC9233AED50BAD4@RichardPC>
To: "WAI Interest Group" <w3c-wai-ig@w3.org>, "Michael A. Peters" <mpeters@domblogger.net>
In the example you give there is a simple solution by using nested tables. 
I know that nested tables have a bad reputation due to frequent miss-use, 
but your example is one of those occasions when they can safely be used.

The code example below shows how this can be achieved. Note that 
screen-readers will announce the container table as one row with two cells 
and then the first table in the first cell and read the values logically row 
by row

<table>
<!-- this is the container table -->
<tr>   <!-- This row holds the two side by side tables -->
<td>
<table>  <!-- left hand table -->
<tr><th>Key</th><th>Value</th></tr>
<tr><td>001</td><td>first</td></tr>
. . .
<tr><td>005</td><td>fifth</td></tr>
</table> <!-- end of left-hand table -->
</td>
<td><!-- next cell in the row of the main table -->
<table>   <!-- right hand table -->
<tr><th>Key</th><th>Value</th></tr>
<tr><td>006</td><td>sixth</td></tr>
. . .
<tr><td>009</td><td>ninth</td></tr>
</table>  <!-- end of right hand table -->
</table> <!-- end of container table -->

Hope that helps you

Richard Warren
www.website-accessibility.com

-----Original Message----- 
From: Michael A. Peters
Sent: Friday, May 04, 2018 9:21 PM
To: WAI Interest Group
Subject: accessible tables

Hello,

I am sure this is covered somewhere, but I just can not find where.

Tabular data, 9 pairs of key = value data. But the table cell contents
are short, so instead of just two columns I want to do four columns
where the third is a continuation of the first and the fourth is a
continuation of the third, e.g.

[ caption of the table]
[ key ] [ value ] [ key ] [ value ]
001     first     006     sixth
002     second    007     seventh
003     third     008     eighth
004     fourth    009     tenth
005     fifth


Is there a way to mark that up so screen readers will read them as pairs
in the order 001 to 009 in order?

I can't be the first to have needed this. 
Received on Sunday, 6 May 2018 21:25:19 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 20:37:17 UTC