Components

Table

Use the table component to make information easier to compare and scan for users.

Dates and amounts
DateAmount
First 6 weeks£109.80 per week
Next 33 weeks£109.80 per week
Total estimated pay£4,282.20
Props
NameTypeDefaultDescription
idother'id' attribute to place on the base HTML element
classBlockotherBlock name override in BEM style classes applied to all elements
classModifiersotherBEM style modifiers to apply to the base HTML element
classNameotherExtra classes to apply to the base HTML element
captionother
dataother
headingsother
keysother

When to use this component

Use the table component to let users compare information in rows and columns.

When not to use this component

Never use the table component to layout content on a page. Instead, use the grid system.

How it works

Table captions

Use the <caption> element to describe a table in the same way you would use a heading. A caption helps users find, navigate and understand tables.

To use a custom caption, supply your element to the prop. (Supplying a string will receive standard styling with the govuk-table__caption--m class.)

Months and rates
Month you applyRate for vehicles
January£95
February£55
March£125

Stories

Standard

A standard Table.

DateAmount
First 6 weeks£109.80 per week
Next 33 weeks£109.80 per week
Total estimated pay£4,282.20

Numbers in a table

IMPLEMENT ME.

Custom column widths

IMPLEMENT ME.