Skip to content

Instantly share code, notes, and snippets.

@jenstrickland
Last active January 19, 2022 23:57
Show Gist options
  • Save jenstrickland/f887113566ede7a5aeeb to your computer and use it in GitHub Desktop.
Save jenstrickland/f887113566ede7a5aeeb to your computer and use it in GitHub Desktop.
HTML Base for an Accessible Table
<table role="table">
<caption>Your table heading</caption>
<thead role="rowgroup">
<tr role="row">
<th scope="col" role="columnheader">th content</th>
<th scope="colgroup" role="columnheader" colspan="3">th content</th>
</tr>
</thead>
<tbody role="rowgroup">
<tr role="row">
<td role="cell">cell content</td>
<td role="cell">cell content</td>
<td role="cell">cell content</td>
<td role="cell">cell content</td>
</tr>
</tbody>
<tfoot role="rowgroup">
<tr role="row">
<td role="cell">cell content</td>
<td role="cell">cell content</td>
<td role="cell">cell content</td>
<td role="cell">cell content</td>
</tr>
</tfoot>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment