Skip navigation.

9.1 Data tables: simplify and mark up with special HTML

Examples

Example code of a simple table showing use of summary, <caption>, <th>, abbr, and scope:

<table summary="Important childrens birthdays to remember. First column: childs name, second: childs age, third: date of birthday" >  
<caption>Important Birthdays</caption>
<tr>   
<th scope="col" abbr="Name" >
Name</th>
<th scope="col" abbr="Age" >
Age</th>
<th scope="col" abbr="Date" >
Date of Birthday</th>
</tr>
<tr>
<th scope="row">Emily</th>    
<td>8 years</td>
 <td>3 September</td>
</tr>
<tr>
<th scope="row">Jack</th>    
<td> 12 years</td>
<td> 28 April</td>
</tr>
</table>
Visual appearance of table coded above, caption appears above the table, the appearance of the column and row headers are distinctive