Markdown Table Syntax and Builder

The pipe-and-dash rules behind a valid Markdown table, up to alignment colons and escaped pipes, plus a builder for assembling one cell by cell.

A Markdown table is punctuation, not a grid you drag around. Learn the shape first, then build yours here without counting characters by hand.

Assemble the table

Decide the columns before the content. Alignment lives in the delimiter row, so fixing it early saves a later cleanup.

The first row is read as the header and the dashes underneath set the column count. Edit cells directly and copy the Markdown once the preview matches.

Header
Columns 1
Columns 2
Columns 3
Header
Row 1
Row 2

Markdown output

Table preview

NamePlanStatus
AvaProActive
BenFreeTrial

When the syntax-first route is the right one

  • You are writing the table by hand into docs, a README, or release notes.
  • The dashes and colons still matter to you, because alignment has to mean something.
  • The table stays small enough that editing cells one by one beats cleaning up an export.

Markdown table syntax, rule by rule

Header row: the first line of pipes holds the column names. Renderers style that line as a header, so it is never treated as data.

Delimiter row: the second line carries only dashes and colons. Its cell count fixes the column count, and every later row is padded or cut to match.

Alignment: a leading colon left-aligns a column, colons on both sides center it, and a trailing colon right-aligns it.

Escaped pipes: a literal vertical bar inside a cell has to be written with a backslash in front of it, otherwise the row gains an extra column.

Line breaks: a raw newline ends the row, so a cell that truly needs two lines uses an HTML break tag.

When the syntax-first route is the right one

If the rows already exist in a CSV or spreadsheet export, the generator skips the syntax work and normalizes the columns for you.

You are writing the table by hand into docs, a README, or release notes.

The dashes and colons still matter to you, because alignment has to mean something.

The table stays small enough that editing cells one by one beats cleaning up an export.