Etch component

Table 1

A data table with a headline, a frame that scrolls sideways on a narrow screen, and an optional note: rates, hours, a price list, a comparison.

Table 1

Copy Table 1

Configurator settings

Change a setting in the configurator to include it.

Optional. Copies the component under its own name, such as News Card Alpha for a site.

Documentation

A data table with a headline, a frame that scrolls sideways on a narrow screen, and an optional note: rates, hours, a price list, a comparison.

How to use it

  • Set the Headline (Text, Tag and Size, as in MAC Headline 1). Its text also names the table's frame for screen readers, so keep it set; Hide Headline hides it from the page, for a table whose section title already says what it is.
  • Build the table in the table slot: a table, with a thead row of th cells (scope col) and a tbody whose rows start with a th (scope row). The pasted component comes with a sample table to edit.
  • Add a Note for a line under the table, such as when the figures take effect.

Good to know

  • A wide table scrolls inside its frame on a phone, and the page doesn't. Visitors using a keyboard can tab to the frame and scroll it with the arrow keys.
  • Cells stay on one line. For a table of longer text, set --mac-table-1-white-space: normal.
  • --mac-table-1-head-background and --mac-table-1-head-text set the header row's colors (--primary and --text-light).
  • For tables kept in a site's own fields, put a loop in the slot's tbody around one row, and bind its cells to the loop's fields.

Reference

Read from the component's JSON, so it's always current.

Loading the reference