Forum Moderators: open

Message Too Old, No Replies

         

ahmedtheking

11:55 am on Sep 14, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What does this mean:

5.1 For data tables, identify row and column headers. [Priority 1]
For example, in HTML, use TD to identify data cells and TH to identify headers.
Techniques for checkpoint 5.1

on [w3.org...]

?

Robin_reala

12:06 pm on Sep 14, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Say you've got a 2x2 table with usernames + post counts.

<table>
<tr>
<td>Robin</td><td>300</td>
</tr>
<tr>
<td>Ahmed</td><td>400</td>
</tr>
</table>

You'd want to add headers to show up what the columns mean. To do this you'd use th elements (table header):

<table>
<tr>
<th>Username</th><th>Post count</th>
</tr>
<tr>
<td>Robin</td><td>300</td>
</tr>
<tr>
<td>Ahmed</td><td>400</td>
</tr>
</table>

Of course, if you want to go more accessible still you'd add some more features. For example:

<table summary="A table containing a list of users and their respective post counts">
<caption>User details</caption>
<thead>
<tr>
<th scope="col">Username</th><th scope="col">Post count</th>
</tr>
</thead>
<tbody>
<tr>
<td>Robin</td><td>300</td>
</tr>
<tr>
<td>Ahmed</td><td>400</td>
</tr>
</tbody>
</table>

benihana

12:07 pm on Sep 14, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Say you have a table of poples names, sex, and ages.

The headers would therefore be Name, Sex and Age

So, you might markup your table like so:

<table>
<caption>Peoples Data</caption>

<tr><th>Name</th><th>Sex</th><th>Age</th></tr>

<tr><td>Joe</td><td>Male</td><td>21</td></tr>

etc etc

</table>

HTH

Ben

added: Alternatively, see robins much more thorough post above :)

ahmedtheking

8:38 pm on Sep 14, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That's fantastic! Thank you!