Skip to content
nexlore

Markdown from scratch · Chapter 5

Tables

A table in Markdown is ordinary text that vertical bars split into columns. Below the header row there is a row of hyphens.

Your first table

How you write it
| Ingredient | Amount |
| ---------- | ------ |
| Flour      | 500 g  |
| Water      | 350 ml |
| Salt       | 10 g   |
How it looks
IngredientAmount
Flour500 g
Water350 ml
Salt10 g

The bars don't have to line up exactly, that just makes it easier to read. You can leave out the bars on the very outside too.

Aligning columns left, centre or right

Colons in the separator row decide whether a column sits on the left, in the centre or on the right.

How you write it
| Item   | Count | Price |
| :----- | :---: | ----: |
| Bread  |   2   |  8.40 |
| Butter |   1   |  2.19 |
How it looks
ItemCountPrice
Bread28.40
Butter12.19

Links and emphasis inside a cell

A cell can hold anything a line can, so bold text, code and links. Only a wiki link with its own text needs a backslash before the bar there, because Markdown would otherwise take the bar for a new column.

How you write it
| Recipe                   | Status     |
| ------------------------ | ---------- |
| [[Bread dough\|The loaf]] | **done**   |
| [[Pizza dough]]          | `open`     |
How it looks
RecipeStatus
The loafdone
Pizza doughopen

Lore saysNobody likes typing tables by hand. In the editor you type / and choose “Table”, and the toolbar has buttons to add rows and columns before or after and to delete them.