Accessible Table Code

Use a summary to summarize the structure of a table.

Use a <caption> for a title or brief description of the table.

Identify row and column headers using <th>.

Identify data cells using <td>.

Associate cells with correct headers using the scope attribute, <th scope="col"> for column headers and <th scope="row"> for row headers.

<table class="table-data" summary="Add summary here (this is not visible to sighted audience)">

<caption>Add caption or title of table.</caption>
<thead>
  <tr>
   <th scope="col">Column header 1</th>
   <th scope="col">Column header 2</th>
   <th scope="col">Column header 3</th>
  </tr>
</thead>
<tbody>
  <tr>
   <th scope="row">Row header 1</th>
   <td>data</td>
   <td>data</td>
  </tr>
  <tr>
   <th scope="row">Row header 2</th>
   <td>data</td>
   <td>data</td>
  </tr>
  </tbody>
</table>