Monu Tools

CSV ⇄ Markdown 表格转换器

将 CSV 转为 Markdown 表格,也可将 Markdown 表格转回 CSV,双向均可。

如何使用 Markdown 表格

  1. 01

    粘贴你的 CSV,第一行作为表头。

  2. 02

    选择分隔符和列对齐方式。

  3. 03

    复制生成的 Markdown 表格。

What it does

This tool converts CSV data into a clean Markdown table you can drop into READMEs, issues, wikis and documentation, and converts Markdown tables back into CSV. The first row becomes the header, and you can set the column alignment.

Writing Markdown tables by hand is fiddly: every row needs the right number of pipes and the alignment divider has to line up. Pasting CSV and getting a correct table back removes all of that busywork.

Everything is processed locally in your browser; nothing you paste leaves your device.

The CSV it reads

It reads standard CSV with comma, semicolon or tab delimiters and handles quoted fields, so data exported from a spreadsheet converts without breaking on commas inside values.

The Markdown it produces

The output is a GitHub-Flavored Markdown table: a header row, an alignment divider, then the data rows. It renders in GitHub, GitLab, most wikis and Markdown editors.

Alignment and escaping

Alignment is written into the divider row using colons, :--- for left, :---: for center and ---: for right, which Markdown renderers use to align each column. Pipe characters in the data are escaped and line breaks inside cells are flattened so the table always stays valid.

常见问题

输出是什么格式?

GitHub 风格的 Markdown 表格:一个表头行、一个对齐分隔行,然后是数据行。它能在 GitHub、大多数 wiki 和 Markdown 编辑器中渲染。

对齐如何工作?

你选择的对齐方式会用冒号写入分隔行(:--- 左对齐、:---: 居中、---: 右对齐),Markdown 渲染器据此对齐每一列。

单元格内的逗号或竖线怎么办?

带引号的 CSV 字段会被正确解析,数据中的任何竖线字符都会被转义以保持表格有效。单元格内的换行会被展平为空格。

我的数据会被上传吗?

不会。表格完全在你的浏览器中生成;你粘贴的内容不会离开你的设备。

来源

嵌入此工具

将此工具添加到你自己的网站。复制下方代码片段即可,它会自动保持最新。

<iframe src="https://monu.tools/embed/zh/markdown-table-converter" width="100%" height="640" style="border:1px solid #e5e5e5;border-radius:12px;max-width:680px" loading="lazy" title="Monu Tools"></iframe>

相关工具