Data Formats

Markdown Table Syntax and Examples

GitHub Flavored Markdown tables use pipes to separate cells and a delimiter row of hyphens beneath the header. Colons in that delimiter row control alignment.

Published

Minimum Markdown table syntax

The first row contains headers. The second row is the delimiter that makes the block a table. Each later row supplies cells in the same column order.

| Name | Status |
| --- | --- |
| API | Ready |
| Docs | Draft |

Align columns with colons

Put a colon on the left for left alignment, on both sides for center alignment, or on the right for right alignment. Renderer support follows the table extension rather than core CommonMark alone.

| Left | Center | Right |
| :--- | :---: | ---: |
| A | B | 42 |

Leading and trailing pipes are optional but clearer

GFM can parse rows without outer pipes, but keeping them makes column boundaries easier to scan and reduces ambiguity during editing and review.

Source columns do not need equal visual width

Extra spaces can align the raw text for people, but parsers trim ordinary padding around cell content. Prioritize readable source without manually maintaining perfect character widths.

Cells can contain inline Markdown

Links, emphasis and inline code are normally parsed inside GFM cells. Block-level elements are not table cell content, and multiline behavior differs between Markdown implementations.

| Item | Reference |
| --- | --- |
| CLI | [`npm test`](https://docs.npmjs.com/) |

Escape a literal pipe inside a cell

Because an unescaped pipe separates cells, write a backslash before a literal pipe. This remains necessary when the pipe appears inside an inline code span in GFM.

| Pattern | Meaning |
| --- | --- |
| `yes\|no` | Either value |

Check the Markdown flavor that will render the table

  • GFM includes tables as an extension; core CommonMark does not define them.
  • Keep header and delimiter column counts consistent.
  • Preview escaped pipes and inline formatting in the target renderer.
  • Use HTML only when the destination permits it and Markdown syntax cannot express the required layout.

Try the example

Import a basic aligned Markdown table

The example contains a header, delimiter row, two body rows and explicit left/right alignment.

| Name | Status | Count |
| :--- | :---: | ---: |
| API | Ready | 12 |
| Docs | Draft | 4 |

Expected result: The generator imports a three-column table and preserves left, center and right alignment in the Markdown output.

Build the table

Generate and preview Markdown

Import a copyable table, adjust alignment and compare the Markdown source with the rendered preview.

Continue in Markdown Table Generator →