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.
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
- The headers and ID attributes (WebAIM)
- Identifying rows and column information (W3C WCAG Techniques 5.1.2)
Sample code (modified from WebAIM):