Markdown Table · GFM · HTML
Convert Markdown table to HTML
Updated: May 2026
Markdown tables are a GitHub Flavored Markdown extension that lets you structure data in rows and columns using pipe characters. Converting them to HTML produces standard <table> elements that work in any browser and can be styled with CSS. This guide covers the complete GFM table syntax and how to convert it to HTML.
Free · No upload · Column alignment preserved
GFM table syntax
A Markdown table starts with a header row, followed by a separator row, then the data rows. Every cell is separated by a pipe character (|). Leading and trailing pipes are optional but help with readability:
| Name | Role | Active |
|----------|-----------|--------|
| Alice | Developer | Yes |
| Bob | Designer | No |
This converts to a full HTML table with <thead> and <tbody> sections. The header row becomes <th> cells and data rows become <td> cells.
Column alignment syntax
The separator row controls alignment using colons. This is the only row that affects alignment — data rows inherit the setting:
| Left-aligned | Centered | Right-aligned |
|:-------------|:--------:|--------------:|
| text | text | text |
:---— left-aligned (default if no colon).:---:— centered.---:— right-aligned.
In HTML, alignment is applied as a style="text-align:left|center|right" attribute on each <th> and <td> element.
Complete HTML output example
A simple two-column Markdown table with right-aligned numbers:
| Item | Price |
|:--------|------:|
| Coffee | 2.50 |
| Pastry | 3.75 |
Produces:
<table>
<thead>
<tr><th style="text-align:left">Item</th><th style="text-align:right">Price</th></tr>
</thead>
<tbody>
<tr><td style="text-align:left">Coffee</td><td style="text-align:right">2.50</td></tr>
<tr><td style="text-align:left">Pastry</td><td style="text-align:right">3.75</td></tr>
</tbody>
</table>
Formatting tables with the Flowfiles formatter
The Format MD mode in the tool aligns table columns automatically. Uneven pipes and cell widths are normalized so columns are visually aligned in the source:
- Paste your unformatted table in the source editor.
- Switch to Format MD mode.
- Click Convert — columns are padded to equal widths.
- Copy the formatted Markdown or switch to MD → HTML for the output.
Frequently asked questions
Do I need leading and trailing pipes?
No. Leading and trailing pipes are optional in GFM tables. However they improve readability and are recommended for consistency.
Can table cells contain Markdown formatting?
Yes. Inline Markdown is supported inside cells: **bold**, *italic*, `code`, links and images all render correctly.
What happens if columns have different numbers of cells?
The converter handles uneven tables gracefully. Missing cells in a row are left empty; extra cells are ignored.
Can I align individual cells differently?
No. In GFM, alignment is set per column in the separator row. All cells in a column share the same alignment.
Does the HTML table include CSS classes?
No built-in class is added. Style the table with your own CSS. The Wrap output option adds a class="markdown-body" wrapper div.