Merged table cells in Markdown (rowspan and colspan) for Word and PDF

Updated

Short answer: write the table in HTML inside your Markdown file and use rowspan and colspan. md-to-pdf-word turns it into a real table with merged cells in both the Word document and the PDF.

Why pipe tables are not enough

Pipe tables (| a | b |) are quick to write but have no way to say “this cell spans two rows”. Some editors add their own extensions, but they rarely survive a conversion to Word.

The HTML way

<table>
  <caption>Quarterly results</caption>
  <tr><th rowspan="2">Product</th><th colspan="2">2026</th></tr>
  <tr><th>Revenue</th><th>Profit</th></tr>
  <tr><td>Alpha</td><td>1,200</td><td>310</td></tr>
  <tr><td>Beta</td><td>860</td><td>140</td></tr>
</table>

Grid tables

If you prefer plain text, grid tables also support merged cells:

+---------+--------+--------+
| Product | Revenue| Profit |
+=========+========+========+
| Alpha   | 1,200  | 310    |
+---------+--------+--------+

Convert

Paste or drop the Markdown into the Markdown to Word converter (or Markdown to PDF). In Word the merged cells are real merged cells — you can keep editing the table.

Tips

Writing syntax

Open as a page

Loading…

Send feedback

Tell us what went wrong or what would make this better. We read every message.

Prefer another way? Email · GitHub