合併單元格的處理方式
要點
- 確認
- 解決辦法
Excel tables sometimes have merged cells for looks. When converted with Convert an Excel Table to HTML or Markdown, a merged cell's text goes only into the top-left one, and the other cells become empty.
Conversion rule
- A merged cell's text goes only into the top-left cell.
- The other cells become empty.
HTML merge attributes are not included. The look may differ from the original table.
What commonly happens
- A "Category" cell merged across 3 rows → only the first row holds "Category"; rows 2 and 3 are empty
- A table title merged across all columns → only the first column holds the title
Steps (to convert cleanly)
- Before converting, unmerge cells in Excel.
- Fill the now-empty cells with the same text.
- Convert with this tool.
- Check the converted table.
Tips for unmerging
- Select the merged cell.
- Press "Merge & Center" to unmerge.
- Copy the text into the emptied cells.
Why not to merge
- Sorting and filtering don't work well
- Empty cells get in the way when handling it as data
- It breaks easily when pasted into web pages or systems
How to fix after converting
If you want to keep merging in HTML, add colspan (column merge) or rowspan (row merge) by hand to the converted HTML.
適合
- Converting clean tables without merged cells
- Extracting just the data from tables that contain merged cells
示例
In a monthly summary, "Q1" was merged across three months. After converting, only January had the text, so I unmerged in Excel, re-entered it for each month and redid it.
Common stumbling blocks
- The text seems to have vanished: when merged, everything except the top-left is empty.
- Columns shift: unmerge before converting.
Frequently asked questions
Can it convert keeping the merge?
The merged look isn't included. Unmerging is the reliable way.
小結
For merged cells, only the top-left gets the text. Unmerge before converting for a clean result.
使用「把 Excel 表格轉換成 HTML 或 Markdown」(免費)搭配使用的工具
- 把 Excel 轉換成 CSV 或 JSON:把 Excel 工作表轉換成 CSV、TSV 或 JSON。
- 把 Word 轉換成 HTML:把 Word 的文字轉換成 HTML。
- CSV 與 JSON 互相轉換:立即在 CSV 和 JSON 之間互相轉換。