Markdown tables are a way to display tabular data in plain text documents using a simple pipe-and-hyphen syntax. They were not part of John Gruber's original Markdown specification (2004) but were introduced as an extension by PHP Markdown Extra and later adopted by GitHub Flavored Markdown (GFM), which made them ubiquitous in the developer community.
Today, Markdown tables are supported by virtually every major Markdown renderer and are commonly used in:
The key advantage of Markdown tables over HTML tables is readability in plain text. A well-formatted Markdown table is legible even in its raw source form, making it ideal for version-controlled documentation where diffs are reviewed in plain text.
A Markdown table consists of three parts: a header row, a separator row, and one or more data rows. Columns are separated by pipe characters (|), and the separator row uses hyphens (-).
| Name | Age | City |
| ------ | --- | ---------- |
| Alice | 30 | New York |
| Bob | 25 | London |
| Carol | 28 | Tokyo |
This renders as a three-column table with a header row (Name, Age, City) and three data rows. The separator row (| --- | --- | --- |) tells the Markdown renderer where the header ends and data begins.
|)---)These two tables are equivalent, but the aligned version is much easier to read in source:
|Name|Age|City|
|---|---|---|
|Alice|30|New York|
| Name | Age | City |
| ----- | --- | -------- |
| Alice | 30 | New York |
Markdown tables support three alignment options, controlled by placing colons (:) in the separator row:
| Left Aligned | Center Aligned | Right Aligned |
| :----------- | :------------: | ------------: |
| Text | Text | Text |
| Left | Center | Right |
:--- or :---: with colon on left: Left alignment (default):---: colons on both sides: Center alignment---: colon on right only: Right alignmentAlignment is particularly useful for numeric data, where right alignment makes numbers easier to compare. Descriptive text is typically left-aligned, while short labels or status values look good centered.
| Package | Version | Size | Status |
| :----------- | :-----: | -----: | :------: |
| react | 18.2.0 | 2.5 kB | stable |
| next | 14.1.0 | 5.1 kB | stable |
| typescript | 5.4.2 | 7.8 kB | stable |
Most Markdown inline formatting works inside table cells:
| Feature | Syntax | Result |
| ------------- | ----------------------- | -------------- |
| Bold | `**bold**` | **bold** |
| Italic | `*italic*` | *italic* |
| Code | `` `code` `` | `code` |
| Link | `[text](url)` | [text](url) |
| Strikethrough | `~~deleted~~` | ~~deleted~~ |
To include a literal pipe character (|) inside a cell, escape it with a backslash: \|. This is necessary because the pipe character is the column delimiter.
You can also use HTML entities inside Markdown table cells for special characters: & for &, < for <, and > for >.
Note: Block-level elements like headings, lists, code blocks, and paragraphs are not supported inside Markdown table cells. If you need complex cell content, consider using HTML tables instead.
| Parameter | Type | Required | Description |
| :-------- | :------- | :------: | :----------------------- |
| `id` | `string` | Yes | The user's unique ID |
| `email` | `string` | Yes | Email address |
| `name` | `string` | No | Display name |
| `role` | `string` | No | One of: admin, user |
| Feature | Free Plan | Pro Plan | Enterprise |
| :--------------- | :-------: | :------: | :--------: |
| API Requests | 1,000 | 50,000 | Unlimited |
| Team Members | 1 | 10 | Unlimited |
| Custom Domains | - | 3 | Unlimited |
| Priority Support | - | - | Yes |
| Action | macOS | Windows/Linux |
| :-------------- | :-------------- | :--------------- |
| Save | `Cmd + S` | `Ctrl + S` |
| Undo | `Cmd + Z` | `Ctrl + Z` |
| Find | `Cmd + F` | `Ctrl + F` |
| Toggle Comment | `Cmd + /` | `Ctrl + /` |
CSV (Comma-Separated Values) is a common format for tabular data exported from spreadsheets, databases, and APIs. Converting CSV to Markdown tables is a frequent task when creating documentation.
To convert CSV to Markdown manually:
| | before the first column and | after the last column on each row| --- | --- | --- |) after the first rowFor example, this CSV:
Name,Language,Stars
React,JavaScript,220000
Vue,JavaScript,206000
Angular,TypeScript,93000
Becomes this Markdown:
| Name | Language | Stars |
| :------ | :--------- | -----: |
| React | JavaScript | 220000 |
| Vue | JavaScript | 206000 |
| Angular | TypeScript | 93000 |
For larger datasets, manual conversion is tedious. Our Markdown Table Generator has a built-in CSV import feature that handles this automatically. Just paste your CSV data and click Apply.
For command-line conversion, you can use a simple script:
# Using awk to convert CSV to Markdown
awk -F',' 'NR==1{printf "| "; for(i=1;i<=NF;i++) printf "%s | ", $i; print "";
printf "| "; for(i=1;i<=NF;i++) printf "--- | "; print ""}
NR>1{printf "| "; for(i=1;i<=NF;i++) printf "%s | ", $i; print ""}' data.csv
While Markdown tables are widely supported, there are subtle differences between renderers:
Platform Tables Alignment Inline HTML
GitHub (GFM) Yes Yes Yes
GitLab Yes Yes Yes (limited)
Bitbucket Yes Yes No
Notion Yes Yes No
Obsidian Yes Yes Yes
Typora Yes Yes Yes
VS Code Preview Yes Yes Yes
Jekyll Yes Yes Yes
Hugo Yes Yes Yes
Docusaurus Yes Yes Yes
CommonMark No* No* Yes
* CommonMark does not include tables in its spec,
but most CommonMark implementations support them
via the GFM tables extension.
The safest approach is to follow the GitHub Flavored Markdown (GFM) table specification, as it is the most widely supported and tested format.
Markdown tables are intentionally simple. Understanding their limitations helps you decide when to use them versus alternatives:
For simple tabular data -- comparisons, parameter lists, keyboard shortcuts, version information -- Markdown tables are perfect. For complex data presentations, consider HTML tables or dedicated visualization tools.
When Markdown tables are not enough, consider these alternatives:
Most Markdown renderers allow inline HTML, so you can use full HTML table syntax within a Markdown document:
<table>
<tr>
<th colspan="2">Merged Header</th>
</tr>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
</tr>
</table>
HTML tables support all features that Markdown tables lack: cell merging, multi-line content, styling, captions, and complex structures. The trade-off is reduced readability in source form and more verbose syntax.
For key-value data with only two columns, Markdown definition lists (supported by some renderers) can be more readable than tables:
Term 1
: Definition or description of term 1
Term 2
: Definition or description of term 2
For fixed-width tabular data where alignment is critical and you do not need rendering features, a code block with manually aligned text works well:
```
NAME VERSION SIZE
react 18.2.0 2.5 kB
vue 3.4.15 4.1 kB
angular 17.1.0 12.3 kB
```
\|).Our Markdown Table Generator makes creating tables effortless:
The tool generates clean, properly formatted Markdown table syntax that works in GitHub, GitLab, Notion, Obsidian, and all major Markdown renderers. Everything runs in your browser with no data sent to any server.
| Header | Header | followed by | --- | --- | and data rows.| :---: |. For left alignment use | :--- | and for right alignment use | ---: |.<table> tags with colspan and rowspan attributes.\|. This prevents the pipe from being interpreted as a column separator. You can also use the HTML entity |.Use our free visual editor to create, edit, and export Markdown tables with alignment and CSV import.
Open Markdown Table Generator →