Simple Data Tables

A "simple" data table is one that has up to two levels of headers. The headers can be on the rows and/or on the columns. Here is an example of a simple data table:

Temperatures in Fairfax
  Summer Winter
High 102 68
Low 72 -2

It has two column headers ("Summer" and "Winter") and two row headers ("High" and "Low").

The code for this table looks like this:

<table width="200" border="1"> 
<caption>
Temperatures in Fairfax
</caption>
<tr>
<th scope="col">&nbsp;</th>
<th scope="col">Summer</th>
<th scope="col">Winter</th>
</tr>
<tr>
<th scope="row">High</th>
<td>102</td>
<td>68</td>
</tr>
<tr>
<th scope="row">Low</th>
<td>72</td>
<td>-2</td>
</tr>
</table>

The scope attribute specifies where the header should be applied. The two options are either col (column) or row.

Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 2.5 License.