Markdown Table Syntax
Write Markdown tables with pipes and dashes, set column alignment, and keep them readable in the editor before you paste.
Direct answer
A Markdown table uses pipes ( | ) to separate columns and a dash row ( --- ) under the header to define it. Add a colon in the dash row to align columns: :--- is left, :---: is center, and ---: is right. Type it in a live editor to confirm the columns line up before pasting.
Open the Markdown EditorWhen to use this
- You need a table in a README, GitHub issue, or docs page.
- You want to control left, center, or right column alignment.
- Your table looks broken and you need to check the pipe and dash structure.
Steps
- Write the header row with a pipe between each column name.
- Add a second row of dashes ( --- ) with one entry per column.
- Add a colon to the dash row to set alignment: :--- left, :---: center, ---: right.
- Add one data row per line, keeping the same number of pipes.
- Preview the table so you can confirm every row has matching columns.
Example
| Feature | Free | Pro | | :--- | :---: | ---: | | Live preview | Yes | Yes | | Export HTML | No | Yes | | Price | $0 | $9 |
Feature | Free | Pro (left) |(center)| (right) ------------- | ------ | ----- Live preview | Yes | Yes Export HTML | No | Yes Price | $0 | $9
Common mistakes
- Every row must have the same number of pipes, or the table falls back to plain text.
- The dash row under the header is required; without it the block is not treated as a table.
- Outer pipes are optional but keep them for readability so misaligned rows are easy to spot.
FAQ
- How do I align columns in a Markdown table?
- Add a colon in the dash separator row. :--- aligns left, :---: centers, and ---: aligns right. Columns without a colon default to left alignment.
- Why is my Markdown table not rendering?
- The most common cause is a missing dash separator row under the header, or a data row with a different number of pipes than the header. Check both in the live preview.
- Can I put a pipe character inside a table cell?
- Yes, escape it with a backslash ( \| ) so the renderer treats it as text instead of a column divider.
Related Markdown guides
Related Markdown editor guides
Markdown Syntax Cheat Sheet
A copy-ready Markdown cheat sheet covering headings, bold, italics, lists, links, images, code, tables, and blockquotes.
How to Write a README in Markdown
Structure a clear README.md with a title, badges, install and usage sections, and a live preview before you commit.
Markdown for GitHub Comments
Format GitHub issue and pull request comments with task lists, code blocks, mentions, and collapsible sections.
Markdown Editor With Live Preview Online
Edit Markdown on the left and see the rendered result on the right in real time, with no login and browser-only drafts.
How to Add Links and Images in Markdown
Add inline links, reference links, and images in Markdown, including titles and clickable image links.
Markdown Task List and Checkboxes
Create checkbox task lists in Markdown for READMEs, GitHub issues, and personal to-do notes with live preview.
Markdown Code Blocks and Syntax Highlighting
Add fenced code blocks with a language for syntax highlighting, plus inline code, in Markdown.