Skip to content
All referenceBlock Elements

Markdown Table

Learn how to create tables in markdown with alignment, formatting, and multi-line content. Syntax, examples, and platform support.

What is markdown table?

Markdown tables use pipes (|) and hyphens (-) to create rows and columns. The second row defines column alignment with colons. Tables are ideal for structured data, comparisons, and reference material.

Syntax

Basic table

A simple table with headers and two data rows.

Result
Header 1Header 2Header 3
Cell 1Cell 2Cell 3
Cell 4Cell 5Cell 6

Column alignment

Use colons in the separator row to align columns left, center, or right.

Result
LeftCenterRight
alignedalignedaligned

Formatted content

You can use inline formatting (bold, italic, code, strikethrough) inside table cells.

Result
FeatureStatus
Boldcode
Italicstrike

Platform support

PlatformSupportedNotes
GitHubYesFull GFM table support
GitLabYes
DiscordNoNo table support — use code blocks instead
SlackNoNo table support
RedditYes
Stack OverflowYes
NotionYesPaste markdown tables or use slash command
ObsidianYes

Common mistakes

Wrong
| Header 1 | Header 2 |
| Cell 1 | Cell 2 |
Right
| Header 1 | Header 2 |
| -------- | -------- |
| Cell 1   | Cell 2   |

The separator row (with hyphens) is required. Without it, the table won't render.

Wrong
| Header 1 | Header 2 |
| --- |
| Cell 1 | Cell 2 |
Right
| Header 1 | Header 2 |
| --- | --- |
| Cell 1   | Cell 2   |

The separator row must have the same number of columns as the header row.

Wrong
| Header |
|--------|
| Cell with | pipe |
Right
| Header |
|--------|
| Cell with \| pipe |

Escape pipes inside cells with a backslash (\|), otherwise they'll be interpreted as column separators.

Tips for table

1Use a table generator

Writing tables by hand is tedious. Use our table generator tool to build them visually and copy the markdown.

2Alignment matters

Use :--- for left, :---: for center, and ---: for right alignment. Default is left-aligned.

| :--- | :---: | ---: |
3Keep it simple

Markdown tables don't support merged cells, multi-line cells, or nested tables. For complex layouts, consider HTML tables.

4Padding is optional

You don't need to align the pipes perfectly — the table renders the same either way. But aligned pipes are easier to read in source.

Frequently asked questions

Everything you need to know.

1

How do I create a table in markdown?

Use pipes (|) to separate columns and hyphens (-) for the separator row between headers and data. Example: | Name | Age |\n| --- | --- |\n| Alice | 30 |

Related elements

Try it in the editor

Paste your markdown and see table rendered instantly with professional themes.