Markdown table generator
Markdown tables are useful in exactly one way and frustrating in twelve. This page explains the syntax, the edge cases, and a way to skip writing them by hand.
The basic Markdown table syntax
Markdown tables use pipe characters to separate columns and a row of dashes to mark the header. The opening and closing pipes are optional in CommonMark and GitHub Flavored Markdown, but including them improves readability when you are editing the raw file.
Each row is one line of text. There must be at least three dashes per column in the separator row, otherwise the renderer treats your “table” as a paragraph with a lot of pipe characters. Cell content is rendered inline, so you can use bold, italics, links, and inline code inside cells — but not block-level elements like lists or fenced code blocks.
Column alignment
You control alignment with the placement of colons in the separator row:
- Colons on the left side of the dashes mean left-aligned (the default)
- Colons on both sides mean center-aligned
- Colons only on the right side mean right-aligned
Alignment is per-column, set in the separator row. Once set, every data cell in that column uses that alignment — you cannot override it row-by-row.
Escaping pipes inside cells
The pipe character is reserved for column boundaries, so if your cell content needs a literal pipe (for example, in a regular expression or a Unix command), you must escape it with a backslash. This is the single most common reason a Markdown table renders incorrectly: an unescaped pipe inside a cell splits that row into the wrong number of columns and most renderers fail silently.
Why generators help
Writing Markdown tables by hand is fine for two-column-three-row tables. Anything wider or longer becomes tedious quickly — column widths drift, escaping rules trip you up, and copy-pasting from a spreadsheet produces a tab-separated mess that needs hand-conversion. A generator solves this by accepting headers and rows as inputs, then emitting properly-formatted Markdown with consistent spacing, escaping, and alignment.
Edge cases worth knowing about
Markdown tables do not support merging cells. If you need rowspan or colspan, you have to drop down to raw HTML inside your Markdown file — most renderers accept HTML inline. They also do not support multi-line cells; if a cell needs a paragraph break, use a line break tag inside it, not an actual newline. Finally, the GitHub renderer trims whitespace inside cells, but some other renderers preserve it, which can cause your “perfectly aligned” Markdown to look different in production than it does in your editor’s preview.
For most documentation needs, Markdown tables are adequate. For data-heavy use cases (financial statements, comparison matrices, anything sortable), embed an HTML table or render data as cards instead — Markdown tables are designed for human-readable structure, not for spreadsheet replacement.
Further reading
- Markdown syntax (Daring Fireball) — John Gruber, 2004
- CommonMark specification — CommonMark
- GitHub Flavored Markdown spec — GitHub Engineering