Tables in MyST

The MyST forms of the specimens on reStructuredText tables, each rendered live by this page’s own Markdown parser. MyST has no grid or simple table: its plain table is the pipe table.

Pipe tables

A pipe table separates cells with |; the row of - under the header sets each column’s alignment with :.

A pipe table

| Directive    | Builds a table from     | Takes a file |
|:-------------|:------------------------|:------------:|
| `list-table` | a two-level bullet list | no           |
| `csv-table`  | comma-separated values  | yes          |

Directive

Builds a table from

Takes a file

list-table

a two-level bullet list

no

csv-table

comma-separated values

yes

List tables

A list table

```{list-table} Builders
:header-rows: 1
:widths: 1 2

* - Builder
  - Writes
* - `ubc build html`
  - A static site.
* - `ubc build pdf`
  - One PDF file.
```
Builders

Builder

Writes

ubc build html

A static site.

ubc build pdf

One PDF file.

CSV tables

CSV tables

```{csv-table} Written inline
:header: Format, Suffix

"reStructuredText", ".rst"
"Markdown (MyST)", ".md"
```

```{csv-table} Read from a file
:file: /../specimens/tables/builders.csv
:header-rows: 1
```
Written inline

Format

Suffix

reStructuredText

.rst

Markdown (MyST)

.md

Read from a file

Builder

Command

Output

Sphinx

sphinx-build -b html

A site

ubCode

ubc build html

A site

ubCode

ubc build pdf

One PDF file

Titled tables

A titled table

```{table} Markup and suffix

| Markup           | Suffix |
|------------------|--------|
| reStructuredText | .rst   |
| MyST             | .md    |
```
Markup and suffix

Markup

Suffix

reStructuredText

.rst

MyST

.md