Master the art of creating clean, organized tables in your markdown documents with this quick reference guide.
Creating tables in markdown is straightforward. Use vertical bars (|) to separate columns and hyphens (-) to create headers. Each row is written on a new line, with columns separated by the pipe character.
The outer pipes (|) are optional, and you don't need to make the raw markdown line up perfectly. The rendered output will be properly aligned.
| Header 1 | Header 2 | Header 3 |
| -------- | -------- | -------- |
| Cell 1 | Cell 2 | Cell 3 |
| Cell 4 | Cell 5 | Cell 6 |
You can align text in columns to the left, right, or center by adding colons (:) to the header row.
| Left-aligned | Centered | Right-aligned |
| :----------- | :------: | ------------: |
| Content | Content | Content |
| Text | Text | Text |
:--
Left alignment (default):-:
Center alignment--:
Right alignmentYou can use most inline markdown formatting within tables, including:
| Formatting | Example |
| ---------- | ------- |
| **Bold** | **text** |
| *Italic* | *text* |
| ~~Strike~~ | ~~text~~ |
| `Code` | `code` |
| [Link](url) | [text](https://example.com) |
|
Markdown tables offer a lightweight, readable way to present structured data in documentation, README files, wikis, and other text-based content. They're widely supported across platforms like GitHub, GitLab, and most markdown editors, making them perfect for sharing information in a consistent format that's both human-readable in its raw form and neatly formatted when rendered.