Skip navigation

For a complex data table, use mark-up to associate data cells and header cells.

(see guidelines for overcoming access barriers)

Complex data tables are those that have two or more logical levels of row or column headers.

There are several options available to handle complex data tables. The HTML tags you use will depend on the type of table you are creating. Here is a summary of the tags used and links to good examples of how to use the tags. Examples and more information can be found on the W3C site http://www.w3.org/TR/REC-html40/struct/tables.html - h-11.4.

For more examples of how to handle complex tables:

http://www.w3.org/TR/REC-html40/struct/tables.html#h-11.4

http://www.webaim.org/techniques/tables/

http://www.macromedia.com/resources/accessibility/dw8/tables.html

Example:

Using mark-up to associate data cells and header cells:

Plants

Animals

Conifers

Flowering

Reptiles

Mammals

Pine Eucalypt Lizard Cat
Cypress Azalea Crocodile Dog

Code for using mark-up to associate data cells and header cells


<table summary="The Plants category is divided into Conifers and Flowering 
and the Animals category is divided into reptiles and mammals">
  <thead>
	<tr>
		<th id="c1-c2" colspan="2"><h2>Plants</h2></th>
		<th id="c3-c4" colspan="2"><h2>Animals</h2></th>
	</tr>
	<tr>
		<th id="c1"><h3>Conifers</h3></th>
		<th id="c2"><h3>Flowering</h3></th>
		<th id="c3"><h3>Reptiles</h3></th>
		<th id="c4"><h3>Mammals</h3></th>
	</tr>
 </thead>
 <tbody>
	<tr>
		<td headers="c1-c2 c1">Pine</td>
		<td headers="c1-c2 c2">Eucalypt</td>
		<td headers="c3-c4 c3">Lizard</td>
		<td headers="c3-c4 c4">Cat</td>
	</tr>
	<tr>
		<td headers="c1-c2 c1">Cypress</td>
		<td headers="c1-c2 c2">Azalea</td>
		<td headers="c3-c4 c3">Crocodile</td>
		<td headers="c3-c4 c4">Dog</td>
	</tr>
 </tbody>
</table>

Back to top