Search

5/07/2008

table th and scope

If you use tables for data





















































Color Names in Multiple Languages
Color Spanish French Irish Welsh
Black negro noir dubh du
White blanco blanc bán gwyn
Red rojo rouge ruadh coch
Blue azul bleu gorm glas
Green verde vert glas gwyrdd
Yellow amarillo jaune buí melyn

The SCOPE attribute in the TH tag is used to further define whether the header is a row ( ) or a column ( ). Designating the SCOPE changes the order in which cells are read out in a screen reader from the default left-to-right, top to bottom order. This code is sufficient for most screen readers to process simple tables (one header row and one header column), but additional tags are needed for more complex tables. See below for details.


In Screen Readers

Because this table contains TH tags with the proper SCOPE definitions, some screen readers will read this table as follows.

Color: Black, Spanish: negro, French: noir, Irish: dubh, Welsh: du.
Color: White, Spanish: blanco, French: blanc, Irish: bán, Welsh: gwyn.
Color: Red, Spanish: rojo, French: rouge, Irish: ruadh, Welsh: coch...

<table>
<caption>
Donuts consumed by each staff member
at Monday Meeting
</caption>
<tr>
<th scope="col"> Color </th>
<th scope="col"> Spanish </th>
<th scope="col"> French </th>
<th scope="col"> Irish </th>
<th scope="col"> Welsh </th>

</tr>
<tr>
<th scope="row"> Black </th>
<td> negro </td>
<td> noir </td>
<td> dubh </td>
<td> du </td>
</tr>
<tr>
<th scope="row"> White </th>
<td> blanco </td>
<td> blanc </td>
<td> bán </td>
<td> gwyn </td>
</tr>
</table>

沒有留言: