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
| Ingredient | Amount | | ---------- | ------ | | Flour | 500 g | | Water | 350 ml | | Salt | 10 g |
| Ingredient | Amount |
|---|---|
| Flour | 500 g |
| Water | 350 ml |
| Salt | 10 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.
| Item | Count | Price | | :----- | :---: | ----: | | Bread | 2 | 8.40 | | Butter | 1 | 2.19 |
| Item | Count | Price |
|---|---|---|
| Bread | 2 | 8.40 |
| Butter | 1 | 2.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.
| Recipe | Status | | ------------------------ | ---------- | | [[Bread dough\|The loaf]] | **done** | | [[Pizza dough]] | `open` |
| Recipe | Status |
|---|---|
| The loaf | done |
| Pizza dough | open |
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.