NanoFile

Markdown tables

A table is rows of cells separated by pipes, with a line of dashes under the header row. Tables are a GitHub-flavoured extension, not original markdown, but support is close to universal now.

A table
| Element | Support |
| --- | --- |
| Tables | GitHub-flavoured |
| Task lists | Yes |
Element Support
Tables GitHub-flavoured
Task lists Yes
Alignment, set with colons
| Left | Centre | Right |
| :--- | :----: | ----: |
| a | b | 1,00 |
Left Centre Right
a b 1,00
A line break inside a cell
| Item | Notes |
| --- | --- |
| One | first line<br>second line |
Item Notes
One first line
second line

`<br>` is the only way. Two trailing spaces do nothing inside a table.

What usually goes wrong

  • The dashed line under the header is required. Without it there is no table, just lines with pipes in them.
  • A pipe inside a cell has to be escaped as \|, or it starts a new column. This bites when a cell contains code with a pipe in it.
  • The outer pipes are optional and the columns do not have to line up in the source. Lining them up costs nothing and makes the raw file readable, which is half the point of markdown.
  • Tables cannot contain paragraphs, lists or fenced code blocks. If you need those, use HTML or restructure.

Questions

How do I make a table in markdown quickly?

Paste your data into the CSV or Excel converter on this site and copy the result. Building a table by hand is fine for three rows and miserable for thirty.

Related