Tables

Do not use tables for page layout or for information that is not tabular (i.e. information with meaning that is dependent on it being in columns or rows in a grid).

Best Practices

  • Headers: Designate row and column headers with the element, which should never be left empty. Simple tables can have two levels of headers.
  • Scope: The “scope” attribute identifies whether a table header is a column header or row header. Each header cell should have scope='col' or scope='row'.
  • Complex tables: If you are building a table that has more than two levels of headers, give each header a unique id and each data cell a header attribute, with each related header cell’s id listed.
  • Title: When adding a title to a table, include it in a <caption> tag inside of the <table> element.

Tools & Resources