Back to blog
Reference
markdown table
gfm tables
formatting
converter

How to Create, Format & Convert Markdown Tables

Master Markdown tables: basic syntax, column alignment, GFM features, inline formatting inside cells, and how to convert tables to Word, PDF, and HTML without breaking them.

Updated September 6, 20267 min readMarkdown to Word Team

Tables are one of the most useful features in GitHub Flavored Markdown. Once you know the syntax, you can lay out pricing pages, feature comparisons, schedules, and data summaries without ever touching a spreadsheet or an HTML editor. The catch is that Markdown tables have strict rules: they cannot merge cells, they cannot contain block-level elements, and they behave differently when copy-pasted into Word than when converted by a proper tool.

This guide covers the anatomy of a Markdown table, the alignment syntax, what you can and cannot put inside a cell, the common mistakes, and the right way to convert tables to Word, PDF, and HTML without breaking them.

Anatomy of a GFM table

For an editable grid or existing spreadsheet data, open the Markdown table generator. It accepts CSV files and cells copied from Excel or Google Sheets, with per-column alignment and Markdown download. Imported values are treated as literal text so currency signs, pipes, and underscores do not change the meaning of your data.

A Markdown table has three parts: a header row, a separator row, and one or more data rows. Each column is separated by a pipe |.

| Name    | Role     | Location |
| ------- | -------- | -------- |
| Ada     | Engineer | London   |
| Brendan | Designer | Tokyo    |

The separator row is the row of hyphens. It is required — without it, the block is treated as plain text. Pipes at the start and end of each row are optional but make the source easier to read.

Readability tip: you do not need to align the pipes vertically in the source. Markdown ignores extra spaces. Many editors auto-align columns for you, but the alignment is purely cosmetic.

Column alignment

You control horizontal alignment with colons in the separator row. This is the part most beginners miss.

SeparatorAlignmentUse case
:---LeftText, names
:---:CenterHeaders, short labels
---:RightNumbers, prices

A table that uses all three:

| Item     | Category  |  Price |
| :------- | :------: | -----: |
| Notebook | Stationery|  $4.50 |
| Pen      | Stationery|  $0.99 |

The colons must sit between hyphens — a lone : with no hyphens will not work, and the separator row must contain at least one hyphen per column.

Formatting inside cells

Cells can contain most inline Markdown, including bold, italics, strikethrough, links, and inline code.

ElementSyntax inside a cell
Bold**text**
Italic*text*
Strikethrough~~text~~
Inline code`code`
Link[text](url)
Image![alt](url) (renders small)
Line break<br>

An example with inline formatting:

| Feature      | Status              | Docs                        |
| ------------ | ------------------- | --------------------------- |
| **Auth**     | ~~beta~~ stable     | [guide](/docs/auth)         |
| **Export**   | `new`               | [guide](/docs/export)       |

Escaping pipes inside cells

If you need a literal pipe character in a cell, write \| so it is not treated as a column separator:

| Command     | Meaning              |
| ----------- | -------------------- |
| `ls \| grep`| Pipe output to filter |

What you cannot do in a Markdown table

Markdown tables are intentionally limited. Knowing the limits saves hours of frustration.

  • Inline formatting (bold, links, code)
  • Numbers, text, short labels
  • Merged cells — there is no colspan or rowspan.
  • Block-level elements — no headings, paragraphs, or nested tables inside a cell.
  • Blockquotes or lists — they will not render inside a cell.
  • Multi-line cell content — a hard line break needs <br>, and even then large blocks look cramped.

If you need merged cells or true multi-line content, you have two options: write raw HTML inside your Markdown (GFM allows inline HTML), or move that content into a real document format like Word.

Examples

A pricing table

| Plan  | Monthly | Annual | Seats |
| :---- | :-----: | -----: | ----: |
| Free  |   $0    |   $0   |     1 |
| Pro   |   $9    |   $90  |     5 |
| Team  |   $29   |  $290  |    20 |

A comparison table with inline code

| Tool     | Command              | Output       |
| -------- | -------------------- | ------------ |
| Markdown | `pandoc in.md -o out.pdf` | PDF file |
| Python   | `python build.py`    | HTML bundle  |

Converting tables to Word, PDF, and HTML

This is where most people lose formatting. A Markdown table that renders perfectly in a preview can fall apart the moment you move it into Word.

Why copy-paste breaks tables

When you select a rendered table in a browser and paste it into Microsoft Word, the result depends on the clipboard format the source page exposed. Often you get:

  • Each cell dumped as a separate paragraph instead of a real Word table.
  • Lost alignment — left/center/right settings vanish.
  • Pipes and hyphens pasted as literal text from the raw Markdown.
  • Broken formatting on inline code and links.

The fix is to convert the Markdown file directly into .docx, .pdf, or .html using a parser that understands tables, rather than copy-pasting.

Convert to Word (.docx)

A dedicated Markdown-to-Word converter parses the table syntax and emits a native Word table object, complete with alignment. Inline **bold** becomes Word bold, `code` becomes monospaced runs, and links become clickable hyperlinks.

Use the Markdown to Word converter: drop in your .md, and the table is rebuilt as a real Word table you can style, sort, and resize inside Word.

Convert to PDF

PDF conversion is the most demanding because tables must fit a fixed page width. The same rules apply as for any document:

  • Keep total columns under ~5 for portrait pages, ~7 for landscape.
  • Shorten header labels so the row does not wrap.
  • Right-align numeric columns for clean scanning.

Use the Markdown to PDF converter to preview pagination before you download. If a table overflows, the preview will show it immediately so you can trim columns before exporting.

Convert to HTML

HTML is the friendliest target — Markdown tables map almost one-to-one onto <table> HTML, and alignment becomes inline text-align styles. Use the Markdown to HTML converter when you need to embed a table in a web page, a documentation site, or an email template. The output is clean, semantic HTML with no extra markup.

Tools and tips

  • Use an editor that auto-formats table pipes — it removes a huge source of typos.
  • Right-align numbers. It makes large tables dramatically easier to read.
  • Keep header labels short; explain them in a caption if needed.
  • Avoid tables for layout. Use lists or headings instead.
  • When a table grows past 6 columns, consider splitting it into two tables.

For wider tables that must stay together, the only reliable route is a converter that lets you set landscape orientation for that section, or splitting the data into multiple smaller tables by topic.

Conclusion

Markdown tables are simple, strict, and surprisingly powerful once you respect their limits. Learn the separator row, get comfortable with the colon alignment syntax, and avoid copy-pasting into Word if you want to keep the structure intact. When you have a table-heavy document ready to ship, run it through the Markdown converter to export a clean Word file, or use the Markdown to PDF tool when PDF is the final format. Your tables will arrive as native, editable objects — pipes and hyphens left behind where they belong.

Related articles