Markdown Table Generator and Formatter
Make and tidy Markdown tables from a grid, CSV or an existing table.
| Row | ||||
|---|---|---|---|---|
| Header | ||||
| 1 | ||||
| 2 |
Use via API
Turn CSV, TSV or an existing Markdown table into a tidy GitHub-flavoured Markdown table, with column alignment and padded columns. The first row is the header. Send JSON, get JSON back.
POST https://pithlab.com/api/v1/tools/markdown-table-generator
curl https://pithlab.com/api/v1/tools/markdown-table-generator \
-H "Authorization: Bearer $PITHLAB_KEY" \
-H "Content-Type: application/json" \
-d '{"input":"Plan,Price,Requests\nFree,0,100\nPro,9,10000","align":"left,right,right"}'About the Markdown Table Generator
Build Markdown tables in an editable grid or from pasted CSV and TSV. Set column alignment, escape pipes and get neatly aligned output, even with CJK and emoji.
How to use the Markdown Table Generator
- Type into the grid, or paste CSV, TSV or an existing Markdown table into the import box and press Load into grid.
- Add or remove rows and columns with the buttons. The first row is the header.
- Choose left, centre or right alignment for each column.
- Keep Pretty align ticked for columns that line up in plain text, then copy the Markdown or download it as a .md file.
Examples
Input
Fruit,Price,Stock Apple,1.20,12 Banana,0.5,140 Kiwi | Gold,2,7
Output
| Fruit | Price | Stock | | :----------- | ----: | :---: | | Apple | 1.20 | 12 | | Banana | 0.5 | 140 | | Kiwi \| Gold | 2 | 7 |
Input
| Name | City | |:--|--:| | 山田 | 東京 | | Zoë 😀 | Paris |
Output
| Name | City | | :----- | ----: | | 山田 | 東京 | | Zoë 😀 | Paris |
Frequently asked questions
How do I put a pipe character inside a cell?
Leave Escape pipes ticked and type | normally. It is written as \| so Markdown keeps it in the cell instead of starting a new column.
Can a cell contain a line break?
Markdown table cells must stay on one line, so line breaks are written as <br>. Most renderers, including GitHub, show that as a line break. Importing a table turns <br> back into a line break.
Why do CJK characters and emoji line up?
Pretty align measures display width rather than characters, counting Chinese, Japanese and Korean characters and most emoji as two columns, like a monospace editor does. It is an approximation, so some rare symbols may still be off by one.
What does alignment change?
It sets the colons in the separator row (:--- left, :---: centre, ---: right), which tells the renderer how to align the column. With pretty align on, the plain text is padded the same way.
Which Markdown flavour is this?
GitHub Flavored Markdown tables, which are also supported by GitLab, Obsidian, many static site generators and most Markdown editors. Rows with fewer cells than the header are padded when imported.