In addition to a nice caption tag and summary attribute, you may know that a data table requires table header cells (TH) for the header rows and/or columns, and a scope attribute (see Web Axe episode 3, Data Tables). But what is there is more than one row of headers? This is called a complex table, and a different type of coding should be used.
Download Web Axe Episode 36 (Complex Data Tables)
A complex table:
- can have any number of rows as a set of headers and/or the first column as a set of headers
- can contain data rows in between the header rows
- uses the
id
andheaders
attributes
Links:
- The headers and ID attributes (WebAIM)
- Identifying rows and column information (W3C WCAG Techniques 5.1.2)
Sample code (modified from WebAIM):
Name
Age
Birthday
by birth
Jackie
5
April 5
Beth
8
January 14
by marriage
Jenny
12
Feb 12