Tables
GFM tables, column alignment, and what happens to a wide table on a narrow screen.
- #authoring
- #markdown
- #tables
GitHub Flavoured Markdown tables, with a shaded header, hairline borders and a row hover. A table earns its place when a reader compares values across the same few fields; prose is better for anything read top to bottom.
A table
Alignment comes from the delimiter row: :--- left, :---: centre, ---:
right. Numbers belong on the right, where their digits line up.
| Component | Tag | Role | Lines |
|---|---|---|---|
| Callout | <Callout /> | note / alert | 118 |
| Tabs | <Tabs /> | tablist | 204 |
| Steps | <Steps /> | list | 96 |
| FileTree | <FileTree /> | tree | 171 |
Cells take inline formatting, such as code, links and emphasis, but not block content. A cell that wants a list or a code block is a sign the table should be a set of headings, or a props table.
Width
A table wider than the measure scrolls inside its own container rather than widening the page, so the prose column keeps its line length and the page never scrolls sideways as a whole.
| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
title | string | no | first # Heading | Falls back to the formatted directory name. |
description | string | no | first paragraph | Truncated at a word boundary near 180 characters. |
date | string | no | none | ISO YYYY-MM-DD. |
updated | string | no | none | ISO YYYY-MM-DD, shown in place of date when present. |
tags | string[] | no | [] | Indexed for search, not printed as chips. |
draft | boolean | no | false | Hidden from listings while true. |
Keep columns few enough that the common case fits. Horizontal scroll is a rescue, not a layout.
Related entries
Typography
Headings and their anchors, inline formatting, blockquotes and rules, as the document surface renders them.
Lists
Bulleted, numbered, nested and task lists, including how a list holding code behaves.
Links
Internal routes, heading anchors, adjacent files and external destinations, and which of them the build checks.