Presenting structured data or comparing features is often best accomplished using clear tables. GitHub-Flavored Markdown (GFM) supports native table rendering through pipes and hyphens, eliminating the need to write verbose HTML table tags. This guide explains how to format basic tables, align columns, apply inline formatting, and organize complex datasets.
Key Takeaways
- Separate columns using pipes (|) and separate headers using hyphens (-).
- Align columns left (:---), right (---:), or center (:---:) with colon indicators in the separator row.
- Format cell text inline using bold, italic, code, and link syntax.
- Keep Markdown tables clean by avoiding block-level elements inside cells.
How to Create a Basic Table in Markdown?
To create a basic table in Markdown, use vertical pipes | to divide columns and hyphens - on the second row to separate the headers from the data rows.
| Name | Age | City |
| ------- | --- | --------- |
| Alice | 28 | Mumbai |
| Bob | 34 | Bangalore |
| Charlie | 22 | Delhi |This compiles into a clean grid:
| Name | Age | City |
|---|---|---|
| Alice | 28 | Mumbai |
| Bob | 34 | Bangalore |
| Charlie | 22 | Delhi |
The HTML equivalent generated by the parser:
<table>
<thead>
<tr><th>Name</th><th>Age</th><th>City</th></tr>
</thead>
<tbody>
<tr><td>Alice</td><td>28</td><td>Mumbai</td></tr>
<tr><td>Bob</td><td>34</td><td>Bangalore</td></tr>
<tr><td>Charlie</td><td>22</td><td>Delhi</td></tr>
</tbody>
</table>How to Align Columns in Markdown Tables?
You can align the text in columns to the left, right, or center by adding colons : to the separator hyphens on the second row of the table.
| Alignment Syntax | Output |
|---|---|
--- or :--- | Left-aligned (default style) |
---: | Right-aligned |
:---: | Centered |
Here is an alignment example in Markdown:
| Left Aligned | Centered | Right Aligned |
| :----------- | :------: | ------------: |
| Apple | Banana | Cherry |
| 100 | 200 | 300 |And this renders in the browser as:
| Left Aligned | Centered | Right Aligned |
|---|---|---|
| Apple | Banana | Cherry |
| 100 | 200 | 300 |
How to Apply Inline Formatting Inside Table Cells?
You can format cell text in a Markdown table just like standard paragraphs. Bold styling, italics, inline code, and links are all fully supported inside cells.
| Feature | Status | Documentation |
| :--- | :--- | :--- |
| **Bold styling** | _Italicized text_ | [Link](https://example.com) |
| `inline code` | ~~Deprecated~~ | [Visit Guide](https://meshworld.in/) |This renders as:
| Feature | Status | Documentation |
|---|---|---|
| Bold styling | Italicized text | Link |
inline code | Visit Guide |
You cannot insert block-level Markdown elements (such as multiple paragraphs, lists, or fenced code blocks) inside table cells. Doing so will break the table format. Use inline code blocks and list items separated by commas instead.
How Do Column Widths Behave in Raw Markdown?
The column widths in your raw Markdown files do not need to match exactly. The parser automatically adjusts the columns to fit the longest line of text.
For example, these two tables produce identical output:
| Name | Age |
| --- | --- |
| Alice | 28 || Name | Age |
| --------| ----|
| Alice | 28 |Although spacing does not affect final rendering, keeping columns aligned in your raw text editor makes it much easier to edit data later.
Summary Checklist
- Use pipes (
\|) to establish columns. - Use hyphens (
-) on the second row to define headers. - Use colons (
:) on the separator row to align columns. - Format cell text with bold, italics, or code elements.
- Avoid block elements like paragraphs and list items inside cells.
Frequently Asked Questions
Can I escape a pipe symbol inside a cell?
Yes! If you want to render a literal pipe symbol | inside a table cell without the parser treating it as a column separator, escape it with a backslash: \|.
Is the outer pipe character mandatory?
No. In most Markdown engines, the outer pipes (at the beginning and end of each line) are optional. However, including them makes the raw text look like a table and prevents formatting bugs.
How do I add vertical lines to borders?
Markdown does not support styling borders or grid lines directly. The final design is determined entirely by your CSS styling (for example, using Tailwind classes).
What to Read Next
- Images in Markdown - Complete Guide — Master adding screenshots, local assets, and linked illustrations.
- Code Blocks in Markdown - Syntax Highlighting Guide — Format multi-line code examples with clean language tags.
Related Articles
Deepen your understanding with these curated continuations.

Autolinks in Markdown: Bare URLs and Emails
Learn the difference between CommonMark's angle-bracket autolinks and GitHub-Flavored Markdown's extended autolinks for bare URLs and email addresses.

Definition Lists in Markdown
Learn the Markdown Extra-style definition list syntax for terms and descriptions, useful for glossaries and API documentation, plus which tooling supports it.

Escaping Special Characters in Markdown
Learn how to escape asterisks, underscores, brackets, and other special characters in Markdown so they display as literal text instead of triggering formatting.


