Skip header information, go directly to content

mwas standard Standard 9 -- Table Headers.
Markup shall be used to associate data cells and header cells for data tables that have two or more logical levels of row or column headers .

Examples:
9.1 -- Table cells are associated with the appropriate headers (e.g. id, headers, scope and/or axis HTML attributes).

Standard 9 -- Table Headers.

See also: Standard 8 -- Tables.

Do Don't

Consider using ID to associate each cell of a data table with its header.

Create a sub-table (table within a table) without associating each cell with its appropriate header.

Why: Unlike using the "scope" attribute, using the "id" and "headers" attributes requires that every data cell in a table include special attributes for association. It can be useful when tables include sub-tables or subsets of data, as it helps insure each cell is associated with the appropriate descriptive header.

How: Define the header using the "id" attribute in the <th> element. Then specify the correct header using the "headers" attribute in the <td> element of each data cell.

Sample HTML table code:

End code.

This table would be displayed as follows:

  Winter Summer
  Morning Afternoon Morning Afternoon
Wilma 9-11 12-6 7-11 12-3
Fred 10-11 12-6 9-11 12-5

 

Get more help with data tables, visit WebAIM's "Creating Accessible Tables."

previousPrevious Nextnext

Top of Page || Return to Index
View/print in PDF format. (Acrobat Reader required.)

Ohio State University