Markdown tables
Updated
A Markdown table is rows of text separated by pipes, with a divider row under the header. It is easy to read once written and tedious to type. This page shows the syntax, then three ways to avoid typing it.
- Header row, then a divider row of dashes, then one line per row. Pipes separate the cells.
- Colons in the divider row set alignment:
:---,:---:,---:. - In the editor, insert a table from the toolbar or paste one, and export the Markdown.
The syntax
| Name | Role | Start |
| ----- | -------- | ----- |
| Ann | Editor | 2024 |
| Bruno | Designer | 2025 |
- The divider row is what makes it a table. Each column needs at least three dashes.
- The columns do not have to line up.
| Ann | Editor | 2024 |works as well; padding is only for people reading the source. - Leave an empty line before the table, or some apps treat it as part of the paragraph above.
- Tables are part of GitHub-flavoured Markdown. They work on GitHub, GitLab, Obsidian, VS Code and most site generators.
Column alignment
| Item | Price | Status |
| :----- | ----: | :----: |
| Coffee | 3.50 | ok |
| Tea | 2.80 | ok |
| Divider | Alignment |
|---|---|
:--- | Left |
---: | Right, the usual choice for numbers |
:---: | Centre |
What a cell can hold
- Inline formatting works: bold, italics,
code, links and pictures. - A pipe inside a cell must be written as
\|, or it starts a new column. - A line break inside a cell is written as
<br>. A real new line ends the row. - No lists, headings or code blocks inside a cell, and no merged cells. If a table needs those, it has outgrown Markdown: keep it as HTML or as a picture.
Three ways not to type it
1. Build it visually
In the RichMarkdown editor, click the table button in the toolbar, choose the size, and type in the cells. View Markdown shows the finished pipe table, and Export .md saves it.
2. Paste it
Copy a table from Google Docs, Word or a web page and paste it into the editor. It arrives as a real table and is exported as a pipe table. Colours and cell borders are dropped, because Markdown has no way to write them.
3. Convert a spreadsheet
Save the sheet as CSV and use CSV to Markdown table. Commas inside quotes, and pipes inside cells, are handled. To tidy a table you already have, Markdown table formatter lines up the columns.
Tables on the way out
| Export | What happens to tables |
|---|---|
| Word (.docx) | Real Word tables you can edit. |
| Printed as tables. A table is kept in one piece, so a very long one may start on a new page; very wide ones are cut at the page edge. | |
| Shared link | Shown as a table on the page. |
Common problems
- The table shows as plain text with pipes. The divider row is missing or has fewer cells than the header, or there is no empty line above the table.
- A column appears from nowhere. A cell contains an unescaped
|. - The table is too wide. Shorten the headers, move long text out into a list below, or split the table in two.
Related guides
FAQ
Does standard Markdown have tables?
The original Markdown does not. Tables come from GitHub-flavoured Markdown, which almost every current tool supports.
How do I merge cells in a Markdown table?
You cannot. Markdown tables have no merged cells. Use an HTML table, or repeat the value in each cell.
How do I put a line break in a cell?
Write <br> where the line should break. A real new line ends the table row.
Do the columns need to line up?
No. Alignment of the source text is only for readability. The pipes and the divider row are what matter.
Can I convert an Excel sheet to a Markdown table?
Yes. Save it as CSV and use the CSV to Markdown table tool, or copy the cells from a document and paste them into the editor.