Markdown has no built-in table command — tables come from GitHub Flavored Markdown (GFM), an extension now supported by most editors, static site generators and chat apps. Everything is built from the pipe character. This guide covers the row syntax, the separator line, column alignment, escaping pipes inside cells, and where GFM tables stop being enough.
The pipe syntax, row by row
A table needs exactly three parts: a header row, a separator row of dashes, and one or more body rows. Pipes divide the cells, and the leading and trailing pipes are optional in most parsers but keep the source readable while you edit.
| Name | City | Score || --- | --- | --- || Ada | London | 98 || Linus | Helsinki | 85 |
The separator row does the heavy lifting
The dashes line is the only required markup: it tells the parser where the header ends and the body begins. Each column needs at least three dashes, and the column count must match the header exactly. If a body row arrives short, most parsers simply render an empty cell rather than throwing an error, so a missing value fails quietly instead of loudly.
Alignment with colons
Colons inside the separator control horizontal alignment for that column. You can left-align, right-align or centre independently, which matters for numbers: right-aligned digits line up so readers can compare magnitudes at a glance.
| Separator | Alignment | Best for |
|---|---|---|
| --- | Left (default) | Names and descriptions |
| ---: | Right | Numbers, money, dates |
| :---: | Centre | Short codes and statuses |
Build rows by hand with the Markdown Table Generator, then paste the finished table into your document, and convert the whole page with the Markdown to HTML Converter when it is ready to publish.
Escaping pipes inside a cell
A raw pipe splits the cell, so text such as "either | or" breaks the row into an extra column. Escape it with a backslash by writing | , or insert the HTML entity | — both render a literal pipe without creating a new column.
Limitations of GFM tables
- No merged cells: colspan and rowspan do not exist, so layouts with spanning headers need raw HTML instead.
- Cells hold inline content only — lists, extra paragraphs and code fences are stripped or break the row.
- One header row, no footer row, and only the three alignment options listed above.
- Very long cell content makes the source painful to edit, and wide tables scroll awkwardly on phones.
Frequently asked questions
Do I need the leading and trailing pipes? No — GFM accepts rows without them — but including them makes tables far easier to align and diff while editing by hand.
Why did my table not render? Almost always the separator row is missing, has fewer dashes than columns, or one row has a different pipe count from the rest. Check that every row has the same number of cells.
Can I put formatting inside cells? Yes: bold, links, code spans and images all work. Block-level content does not — flatten it into a single line before you insert it.