🔍

首页Home › 开发工具Developer Tools

📄 HTML 表格转 CSVHTML Table to CSV

把 HTML 里的第一个表格转换成 CSV:合并单元格(colspan/rowspan)会展开以保持列对齐,忽略 script 和 style 标签里的内容,br 换行标签可变成换行或空格,实体字符自动解码。本地处理。Turn the first table in a piece of HTML into CSV. Merged cells (colspan/rowspan) are expanded so the columns stay aligned, text inside script and style tags is ignored, br tags become a line break or a space, and entities are decoded. Runs locally.

使用说明与常见问题How-to & FAQ

「HTML 表格转 CSV」是什么?What is the HTML Table to CSV tool?

把 HTML 里的第一个表格转换成 CSV:合并单元格(colspan/rowspan)会展开以保持列对齐,忽略 script 和 style 标签里的内容,br 换行标签可变成换行或空格,实体字符自动解码。本地处理。Turn the first table in a piece of HTML into CSV. Merged cells (colspan/rowspan) are expanded so the columns stay aligned, text inside script and style tags is ignored, br tags become a line break or a space, and entities are decoded. Runs locally.

如何使用「HTML 表格转 CSV」?How do I use the HTML Table to CSV tool?

在「HTML 表格转 CSV」中,先在上方输入或粘贴内容,然后点击「转换」、「复制」按钮即可。Paste HTML that contains a table (a whole page is fine) and click "Convert". Choose how merged cells are filled and whether br tags become spaces, then click "Copy" to copy the CSV.

会转换哪个表格?Which table is converted?

只转换页面里的第一个 table;嵌套在单元格里的子表格不会单独拆行。Only the first table on the page is converted; a table nested inside a cell is not split into rows of its own.

合并单元格(colspan / rowspan)怎么处理?How are merged cells (colspan / rowspan) handled?

会按合并范围展开成完整的格子,保证各列对齐。默认值只写在左上角第一格、其余格子留空(和电子表格合并单元格一样);选择"每格都写值"则每个被合并的格子都填同样的内容。结果下方会说明展开了几个合并单元格。They are expanded over the cells they cover, so the columns stay aligned. By default the value goes in the top-left cell and the other covered cells stay empty, as in a spreadsheet merge; choose "repeat the value in every cell" to fill each covered cell with the same text. A note below the result says how many merged cells were expanded.

script、style 和 <br> 会怎样?What about <script>, <style> and <br>?

单元格里的 <script> 和 <style> 内容会被忽略,不会混进文字;<br> 默认变成单元格内的换行(CSV 里会加引号),勾选"<br> 换成空格"则变成空格。Text inside <script> and <style> in a cell is ignored and never leaks into the data. A <br> becomes a line break inside the cell by default (the CSV quotes that cell); tick "Turn <br> into a space" to get a space instead.

有哪些选项可以调整?What options can I adjust?

可以选择合并单元格怎么填:“只在第一格写值”(默认)或“每格都写值”;也可以勾选“<br> 换成空格”。改动任一设置后结果会立即更新。You can choose how merged cells are filled — "value in the first cell only" (the default) or "repeat the value in every cell" — and tick "Turn <br> into a space". The result updates as soon as you change either setting.

行的单元格数不一致会怎样?What if rows have different numbers of cells?

按原样输出,不补也不删单元格(合并单元格展开后的格子除外),结果下方会提示有几行的单元格数和最宽的行不同。需要统一列数时,可以把结果交给“CSV 补齐不完整行”。Each row is written as it is, with no cells added or removed (apart from the cells a merged cell is expanded into), and a note below the result says how many rows have a different number of cells from the widest row. To give every row the same width, run the result through Fill Incomplete CSV Records.

表头里有重名的列会怎样?What if two header cells have the same name?

照常转换,不会改名也不会合并;结果下方会提示哪些列重名(例如“表头里有 2 列都叫「A」(第 1、2 列)”),因为之后按列名查找时只会找到第一列。The table is converted as usual, with nothing renamed or merged, and a note below the result names the repeated columns (for example: the header has 2 columns named "A" (columns 1, 2)), because looking a column up by that name later finds the first one only.

代码或数据会被上传吗?Is my code or data uploaded?

不会。「HTML 表格转 CSV」完全用 JavaScript 在本地运行,适合处理含有密钥、内部接口等敏感内容的数据。No. The HTML Table to CSV tool runs entirely in local JavaScript, so it is safe for data containing keys or internal endpoints.

「HTML 表格转 CSV」免费吗?需要注册吗?Is the HTML Table to CSV tool free? Do I need an account?

「HTML 表格转 CSV」完全免费,无需注册或安装,打开网页即可使用,手机和电脑都能用;输入的内容只在你的浏览器本地处理。The HTML Table to CSV tool is completely free with no sign-up or install and works on phones and desktops; what you enter is processed only in your browser.

相关工具Related tools

📄 HTML 表格转 JSONHTML Table to JSON📝 文本转 HTMLText to HTML📊 Excel 转 XMLExcel to XML📄 TSV 转 YAMLConvert TSV to YAML📄 YAML 转 TSVConvert YAML to TSV⚛️ HTML 转 JSXHTML to JSX Converter📄 XML 转 Base64XML to Base64📊 XML 转 ExcelXML to Excel🌿 Jade/Pug 转 HTMLJADE to HTML Converter🌿 HTML 转 Jade/PugHTML to JADE Converter📄 HTML 转 LaTeXHTML to LaTeX📄 Markdown 转 YAMLMarkdown to YAML

← 全部工具All tools