Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk3 min

HTML-to-Markdown Tables with Colspan: Why GFM Loses Merged Cells

GFM pipe tables cannot preserve HTML colspan or rowspan. Keep the table as HTML where supported, expand spans into a rectangular grid, or use prose for irregular data.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If an HTML table with merged cells comes out of an HTML-to-Markdown conversion misaligned or incomplete, the target format may be the reason. Ordinary GitHub Flavored Markdown (GFM) pipe tables cannot encode colspan or rowspan, so they cannot preserve the same merged-cell structure. Keep the table in HTML where supported, or reshape its content for Markdown.

Why merged cells break in GFM pipe tables

An HTML table can use colspan to make one cell cover multiple columns and rowspan to make it cover multiple rows. GFM pipe tables have a fixed header and delimiter structure instead; they do not provide attributes for spanning cells. MDN’s Markdown guidance explicitly lists colspan and rowspan among the table attributes GFM does not support: MDN, “How to write in Markdown”.

As an Amazon Associate I earn from qualifying purchases.

That means a converter can read the HTML source yet still lack a way to represent its merged-cell layout in the selected Markdown flavor. The result may have rows that no longer align with the logical columns. GFM specifies how to handle rows with too few or too many cells: missing cells are inserted and excess cells are ignored. Depending on how a converter emits a row, content can therefore appear shifted or be lost. See the GFM specification.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose a workaround based on the destination

Approach When it fits Trade-off
Keep the table as HTML The destination allows and preserves raw HTML tables and span attributes. Retains merged-cell structure where supported; renderer compatibility is required.
Expand the table into a rectangular grid The destination requires a GFM pipe table and repeated values remain understandable. Preserves information by repeating labels or values, but does not create native merged cells.
Use prose or lists Repeated entries would be confusing, or the table is irregular. Changes the presentation, but may make relationships easier to follow.

Keep the table as HTML

If raw HTML is accepted by the destination, retain the original table markup, including its span attributes. MDN recommends HTML when a GFM table needs unsupported features. Check the destination renderer rather than assuming that it will allow or preserve the markup.

Expand spans into a rectangular grid

If pipe-table output is mandatory, represent each logical column explicitly. Repeat the spanning label or value in every cell it covers, then compare each row with the original HTML table. This is a workaround that makes the relationships explicit; it is not merged-cell support in Markdown.

Switch to prose or lists for irregular relationships

For a table where repeating labels would obscure which values belong together, describe the groups in prose or use nested lists. A fixed pipe grid is not always the clearest way to communicate data that was organized with irregular spans.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What Pandoc conversion does—and does not—guarantee

Pandoc documents this general HTML-to-Markdown command:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

pandoc -f html -t markdown hello.html

It converts from an HTML input format to a Markdown output format, but that alone does not guarantee that merged-cell semantics survive. The output has to fit the chosen Markdown flavor, and GFM cannot encode these spans. Review the generated table against the original and check how the destination renders it. See the Pandoc User’s Guide and the GFM specification.

Check the conversion before publishing

  • Compare every output row with the source table, especially rows affected by a span.
  • Look for missing cells, shifted values, or content that appears under the wrong heading.
  • Confirm that the selected destination accepts raw HTML if you keep the original table markup.
  • If converting to a pipe table, ensure each row matches the logical grid and that any repeated labels remain clear.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.