Tables

Use tables to display tabular data only, never for layout!

Jump to a component:

Basic tables

Most tables on the website are basic tables.

Styling

Table headings have gray shading (column headings are slightly darker than row headings), and there is a light gray divider between all table cells. Table text is slightly smaller than body text.

How to use for Basic tables

Using tables in WordPress requires a plugin. Get approval from the Web Team to use it.

The plugin lets editors insert a table with a certain number of rows and columns; merge or split table cells; add or remove table rows; copy, cut, or paste table rows; and add table headings.

Example of Basic tables

This example includes an optional footer.

Regular table
Column heading Column heading Column heading Column heading Column heading Column heading
Row heading Data Data Data Data Data
Row heading Data Data Data Data Data
Footer heading Data Data Data Data Data

Sortable tables

Use a sortable table if you need the table data to be able to sort by column.

Styling

Same as basic tables, but an up/down arrow is added after each table heading.

How to use for Sortable tables

Same as basic tables. See “development info” for how to make the table sortable.

Note: If the table has a footer, the footer cells won’t be included in the sorting.

Example of Sortable tables
Sortable table
Column heading Column heading Column heading
Row heading 1 Data 1 Data 1
Row heading 2 Data 2 Data 2
Row heading 3 Data 3 Data 3

Tables with a visible caption

All tables should have a caption that provides an accessible description of the table contents, but the caption can either be visible or visually hidden.

Styling

Same as basic tables, but with a row directly above the table headers that displays the caption. Captions can have a Font Awesome icon before the text.

How to use for Tables with a visible caption

Same as basic tables. See “development info” for how to add a visible caption.

Example of Tables with a visible caption
clock Table with a visible caption
Column heading Column heading Column heading Column heading
Row heading Data Data Data
Row heading Data Data Data
Row heading Data Data Data

Tables with zebra stripes

Large or complex tables can benefit from zebra striping, which makes it easier to distinguish one row from the next and to follow the data from one column to the next.

Styling

Same as basic tables, but every other row has a slightly darker background.

How to use for Tables with zebra stripes

Same as basic tables. See “development info” for how to add zebra striping.

Example of Tables with zebra stripes
Table with zebra stripes
Column heading Column heading Column heading Column heading
Row heading 1 Data 1 Data 1 Data 1
Row heading 2 Data 2 Data 2 Data 2
Row heading 3 Data 3 Data 3 Data 3
Row heading 4 Data 4 Data 4 Data 4

If the table has rowspans, you’ll need to hardcode the stripes:

Complex table with zebra stripes
Column heading Column heading Column heading Column heading
Row heading 1 Data 1.1 Data 1.1 Data 1.1
Data 1.2 Data 1.2 Data 1.2
Row heading 2 Data 2.1 Data 2.1 Data 2.1
Data 2.2 Data 2.2 Data 2.2
Row heading 3 Data 3.1 Data 3.1 Data 3.1
Data 3.2 Data 3.2 Data 3.2
Row heading 4 Data 4.1 Data 4.1 Data 4.1
Data 4.2 Data 4.2 Data 4.2