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.
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 atheadrow ofthcells (scopecol) and atbodywhose rows start with ath(scoperow). 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-backgroundand--mac-table-1-head-textset the header row's colors (--primaryand--text-light).- For tables kept in a site's own fields, put a loop in the slot's
tbodyaround one row, and bind its cells to the loop's fields.