exceltomarkdown.com
Reference

Markdown Table Syntax Reference

The smallest complete description of GitHub Flavored Markdown tables — nothing more than you need to read and fix them.

Header and separator rows

A table needs at least a header row and a separator row of dashes. The separator is what tells the renderer "this is a table" — without it, pipes render as plain text:

| Product  | Qty |
|:---------|:---:|
| Widget A | 10  |

Column alignment

Colons in the separator row control alignment:

Cell content rules

What GFM tables do not support

No merged cells, no nested tables, no block elements (lists, headings, fenced code) inside cells. When data needs that structure, simplify the table or link out to the full source. Tables that violate these rules are covered in why Markdown tables break and how to fix them.

The CommonMark & GFM Specification Architecture

Original Markdown as created by John Gruber in 2004 contained no native syntax for tables. In response to divergent parser implementations across PHP Markdown Extra, MultiMarkdown, and Pandoc, GitHub formalized theGFM Table Extension (Section 4.12) as a strict layer on top of CommonMark 0.29.

The parser uses a deterministic lexical state machine:

Escaping Characters: The Delimiter Precedence Hierarchy

Certain characters hold special syntactic meaning in Markdown and must be handled carefully when embedded within tabular cells:

Whitespace Padding vs Rendered Output

Many developers spend hours manually padding columns with spaces so the raw plain-text source file looks like a clean ASCII grid:

| ID   | Item Name            | Unit Price |
|:-----|:---------------------|-----------:|
| 101  | Mechanical Keyboard  |    $129.00 |
| 102  | Optical Gaming Mouse |     $59.50 |

While column padding makes the raw git diff significantly more readable, it has zero effect on rendered HTML. A compacted table with no internal spacing renders identically:

|ID|Item Name|Unit Price|
|:---|:---|---:|
|101|Mechanical Keyboard|$129.00|
|102|Optical Gaming Mouse|$59.50|

Our converter automatically generates properly padded whitespace tables by calculating the maximum character width across every column.

When to Drop Back to Raw HTML Tables

Markdown tables are intentionally constrained to 2D flat structures. If your dataset requires any of the following features, you must use standard HTML <table> syntax instead:

GitHub Flavored Markdown fully renders raw HTML tables in README files and issues, making HTML the standard escape hatch for advanced documentation matrices.

Right-to-Left (RTL) Scripts in Markdown Tables

When documenting datasets containing Arabic, Hebrew, or Persian text alongside English parameters, bidirectional text layout can cause visual confusion in plain-text editors:

Browser Performance & DOM Memory Limits

While Markdown source files are lightweight, browsers convert table tokens into live DOM tree nodes:

GFM Table Syntax Cheat Sheet & Delimiter Reference

Keep this reference table handy when authoring or debugging complex Markdown documentation tables across your projects:

FeatureSyntax ExampleParsed ResultGFM Compliance Rule
Left Alignment| :--- |Left-aligned textDefault when colons are omitted
Center Alignment| :---: |Centered textIdeal for icons, badges, and statuses
Right Alignment| ---: |Right-aligned textMandatory for currencies and numeric figures
Literal Pipe\|Displays as |Prevents cell fragmentation
In-Cell Line BreakLine 1<br>Line 2Line 1
Line 2
Literal newlines terminate table row

Markdown Dialect Comparison: GFM vs Pandoc vs MultiMarkdown

Different markdown compilers introduce unique extensions to tabular syntax:

Best Practices for Collaborative Git Workflows

When multiple developers edit Markdown tables in shared pull requests, merge conflicts frequently arise along delimiter boundaries:

Related guides

Frequently asked questions

How do I align a Markdown table column left, center, or right?

Use colons in the separator row: :--- for left, :---: for center, ---: for right. Alignment is a rendering hint — the raw text stays readable either way.

How do I put a line break inside a table cell?

Use an explicit <br> tag. A literal newline ends the table row in most renderers, so multiline content must be joined onto one line.

Do Markdown tables support merged cells?

No. GitHub Flavored Markdown has no colspan or rowspan. Repeat the value in each cell or restructure the data so every row has the same flat column layout.