Compare structured data
Use tables when each record shares the same fields.
Use tables when each record shares the same fields.
Rows and columns give repeated information a predictable position.
Include links or controls, with behaviour handled by your application.
Header row
Data row
Data cell
Border (optional)
Header cell
Header background (optional)
Row divider (bottom)
Use headerPosition with rowHeader, columnHeader and tableData to generate headers across the top, down the side, or both. When using slotted rows, arrange the headers manually.
Headers across the top. Most common arrangement for tabular data.
Use headerBackground to apply a tinted fill to the header cells for stronger visual separation from the body.
Plain header. Suits tables embedded in low-contrast surfaces.
Use tableBorder to add an outer border to a table with slotted rows. Horizontal row dividers remain visible with or without this option.
Horizontal dividers separate rows without an outer border.
Keep wide tables in a labelled, keyboard-focusable container that scrolls horizontally. Rows and columns keep their structure. The legacy responsive property is deprecated.
Focus the container and use the Left and Right arrow keys to scroll when the table is wider than the available space.
Table layout controls whether columns size automatically or use fixed distribution.
Use auto layout when content length should influence column sizing.
Each row is a colour, spacing, or size value the component uses, and the right-most column tells you where in the component you'll see it.
sgds-padding-md16pxsgds-padding-sm—sgds-border-width-0Width variessgds-border-width-11pxsgds-font-weight-semibold—sgds-dimension-56—Put the same type of information in each column so users can compare records.
Consider a description list when presenting one item’s details, such as its name, email, and role.
Choose headers that explain the values below them, such as “Service”, “Owner”, and “Status”.
Keep primary actions visible. Group secondary actions in an overflow menu when space is limited.
headerPosition rather than assuming a slotted header becomes a row header when moved to the left. Slotted sgds-table-head elements use the columnheader role.TabShift+TabLeftorRight arrowEnterorSpaceShare them with us on Slack → #ask-sgds-v3
Report it on GitHub Issues → sgds-web-component
The Singapore Government Design System was developed to empower teams in creating fast, accessible and mobile-friendly digital services.