Skip to content

Technique H63:Using the scope attribute to associate header cells with data cells in data tables



This technique relates to 1.3.1: Info and Relationships (Sufficient when used with Making information and relationships conveyed through presentation programmatically determinable using the following techniques: ).


The objective of this technique is to associate header cells with data cells in complex tables using the scope attribute. The scope attribute may be used to clarify the scope of any cell used as a header. The scope identifies whether the cell is a header for a row, column, or group of rows or columns. The values row, col, rowgroup, and colgroup identify these possible scopes, respectively.

For simple data tables where the header is not in the first row or column, like the one in Example 1, this technique can be used.

For simple tables that have the headers in the first row or column, it is sufficient to simply use the th elements without scope.

For complex tables use ids and headers as in Using id and headers attributes to associate data cells with header cells in data tables.

Some users may find it easier to work with several simple tables than one more complex table. Authors may wish to consider whether they can convert complex tables to one or more simple tables.


Example 1: A simple schedule

In the following example, the first column contains serial numbers for rows in the table, and the second column contains the key value for the row. The cells in the second column may then use scope="row". The cells in the first row too are marked up with td and use scope="col".

  <caption>Contact Information</caption>
    <th scope="col">Name</th>
    <th scope="col">Phone Number</th>
    <th scope="col">City</th>
    <th scope="row">Charlotte Smith</th>
    <th scope="row">Joetta Frere</th>
    <th scope="row">David Walls</th>
    <td>New York</td>

Other sources

No endorsement implied.



For each data table:

  1. Check that all th elements have a scope attribute.
  2. Check that all scope attributes have the value row, col, rowgroup, or colgroup.

Expected Results

  • All checks above are true.
Back to Top