Quote:
Originally Posted by Clancolin
I'm creating a long (multiple-row) table, consisting of two colums as part of an epub. [...] I'm confused as the the best way to add accessibility to this.
Number Weather
00 Dry
01 Wet
02 Sunny
|
Code:
<table>
<thead>
<tr>
<th scope="col">Number</th>
<th scope="col">Weather</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">00</th>
<td>Dry</td>
</tr>
<tr>
<th scope="row">01</th>
<td>Wet</td>
</tr>
<tr>
<th scope="row">02</th>
<td>Sunny</td>
</tr>
</tbody>
</table>
Web Accessibility Tutorials (WAI) has pretty good examples of different tables:
https://www.w3.org/WAI/tutorials/tables/
Just note, stuff like <caption>, <figure>, <figcaption>, don't work too well in many readers... so probably avoid using those.
If you need titles/captions, usually I just add a <p class=""> outside of the <table> itself:
Code:
<p class="tabletitle">Table 1: The Weather</p>
<table>
[...]
</table>
<p class="caption">This is a caption.</p>