{"id":1131,"date":"2026-11-30T22:00:00","date_gmt":"2026-11-30T22:00:00","guid":{"rendered":"https:\/\/thenesttools.com\/blog\/?p=1131"},"modified":"2026-11-29T08:27:11","modified_gmt":"2026-11-29T08:27:11","slug":"markdown-table-syntax","status":"publish","type":"post","link":"https:\/\/thenesttools.com\/blog\/markdown-table-syntax\/","title":{"rendered":"Markdown Table Syntax: Examples, Alignment and Common Mistakes"},"content":{"rendered":"<p><strong>To make a table in Markdown, write each row on its own line with cells separated by pipes (<code>|<\/code>), and put a separator row of dashes under the header: <code>| Name | Price |<\/code>, then <code>|------|-------|<\/code>, then <code>| Tea | 3 |<\/code>.<\/strong> Add colons to the separator to align columns: <code>:---<\/code> left, <code>:---:<\/code> centre, <code>---:<\/code> right. Tables are part of GitHub Flavored Markdown, so they work on GitHub, GitLab, Obsidian, Reddit and most modern editors.<\/p>\n<h2>Basic Markdown Table<\/h2>\n<pre><code>| Day | Task        | Hours |\n|-----|-------------|-------|\n| Mon | Writing     | 2     |\n| Tue | Client call | 1     |<\/code><\/pre>\n<p>The rules:<\/p>\n<ul>\n<li>The <strong>first row<\/strong> is the header.<\/li>\n<li>The <strong>second row<\/strong> must contain at least three dashes per column (<code>---<\/code>).<\/li>\n<li>Pipes at the start and end of each line are optional, but they make the table easier to read.<\/li>\n<li>Cells don&#8217;t have to line up in the source. Spacing is only for humans.<\/li>\n<\/ul>\n<h2>Aligning Columns<\/h2>\n<pre><code>| Item   | Qty | Price |\n|:-------|:---:|------:|\n| Coffee |  2  |  4.50 |\n| Bagel  |  1  |  3.25 |<\/code><\/pre>\n<table>\n<thead>\n<tr>\n<th>Separator<\/th>\n<th>Alignment<\/th>\n<th>Typical use<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>:---<\/code> or <code>---<\/code><\/td>\n<td>Left (default)<\/td>\n<td>Text<\/td>\n<\/tr>\n<tr>\n<td><code>:---:<\/code><\/td>\n<td>Centre<\/td>\n<td>Short codes, ticks, status<\/td>\n<\/tr>\n<tr>\n<td><code>---:<\/code><\/td>\n<td>Right<\/td>\n<td>Numbers and prices, so decimals line up<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>What HTML Does It Produce?<\/h2>\n<p>A Markdown converter turns the table into standard HTML table tags. Alignment becomes an <code>align<\/code> attribute on each cell. Paste any table into the free <a href=\"https:\/\/thenesttools.com\/markdown-to-html\/\">Markdown to HTML converter<\/a> to see the preview and copy the HTML:<\/p>\n<pre><code>&lt;table&gt;\n&lt;thead&gt;&lt;tr&gt;&lt;th align=\"left\"&gt;Item&lt;\/th&gt;&lt;th align=\"center\"&gt;Qty&lt;\/th&gt;&lt;th align=\"right\"&gt;Price&lt;\/th&gt;&lt;\/tr&gt;&lt;\/thead&gt;\n&lt;tbody&gt;&lt;tr&gt;&lt;td align=\"left\"&gt;Coffee&lt;\/td&gt;&lt;td align=\"center\"&gt;2&lt;\/td&gt;&lt;td align=\"right\"&gt;4.50&lt;\/td&gt;&lt;\/tr&gt;\n\u2026\n&lt;\/tbody&gt;&lt;\/table&gt;<\/code><\/pre>\n<h2>Formatting Inside Cells<\/h2>\n<p>You can use inline Markdown inside a cell: <code>**bold**<\/code>, <code>*italic*<\/code>, <code>`code`<\/code> and <code>[links](https:\/\/example.com)<\/code>. Block elements such as lists, headings or multiple paragraphs can&#8217;t go inside a cell.<\/p>\n<h3>How to put a pipe character in a cell<\/h3>\n<p>Escape it with a backslash: <code>\\|<\/code>. Without the backslash, Markdown treats it as a new column.<\/p>\n<h3>How to add a line break in a cell<\/h3>\n<p>Markdown has no line-break syntax inside table cells, but most converters accept the HTML tag <code>&lt;br&gt;<\/code>: <code>| Line one&lt;br&gt;Line two |<\/code>.<\/p>\n<h3>How to leave a cell empty<\/h3>\n<p>Just put nothing between the pipes: <code>| Tea |  | 3 |<\/code>.<\/p>\n<h2>Common Mistakes<\/h2>\n<table>\n<thead>\n<tr>\n<th>Problem<\/th>\n<th>Cause<\/th>\n<th>Fix<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Table shows as plain text<\/td>\n<td>Missing separator row<\/td>\n<td>Add <code>|---|---|<\/code> under the header<\/td>\n<\/tr>\n<tr>\n<td>Table shows as plain text<\/td>\n<td>No blank line before the table<\/td>\n<td>Leave an empty line above it<\/td>\n<\/tr>\n<tr>\n<td>Columns shift<\/td>\n<td>Unescaped <code>|<\/code> inside a cell<\/td>\n<td>Use <code>\\|<\/code><\/td>\n<\/tr>\n<tr>\n<td>Extra cells ignored<\/td>\n<td>A row has more cells than the header<\/td>\n<td>Match the header&#8217;s column count<\/td>\n<\/tr>\n<tr>\n<td>Doesn&#8217;t render at all<\/td>\n<td>Platform uses strict CommonMark<\/td>\n<td>Use a GFM-compatible tool, or convert to HTML<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Faster Ways to Make Markdown Tables<\/h2>\n<ul>\n<li><strong>From a spreadsheet:<\/strong> many editors and online converters turn copied spreadsheet cells into Markdown tables. Check the output in a preview.<\/li>\n<li><strong>Editor plugins:<\/strong> VS Code and Obsidian have extensions that auto-align pipes as you type.<\/li>\n<li><strong>Keep it narrow:<\/strong> tables wider than about five or six columns are hard to read on phones. Split them, or use a list instead.<\/li>\n<\/ul>\n<p>For other Markdown elements, see <a href=\"https:\/\/thenesttools.com\/blog\/markdown-task-lists-checkboxes\/\">Markdown checkboxes and task lists<\/a>.<\/p>\n<h2>Frequently Asked Questions<\/h2>\n<h3>Do Markdown tables need a header row?<\/h3>\n<p>Yes. GitHub Flavored Markdown requires a header row followed by the dashed separator row. If you don&#8217;t want visible headers, some people leave the header cells empty, though this depends on the renderer.<\/p>\n<h3>Can I merge cells in a Markdown table?<\/h3>\n<p>No. Markdown tables don&#8217;t support merged cells (colspan or rowspan). Use an HTML table if you need them.<\/p>\n<h3>How many dashes do I need in the separator row?<\/h3>\n<p>At least three per column. More is fine and makes the source easier to read.<\/p>\n<h3>Why isn&#8217;t my Markdown table rendering?<\/h3>\n<p>Usually a missing separator row, no blank line above the table, or a platform that doesn&#8217;t support GFM tables.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Pipes for columns, dashes under the header, colons to align. Markdown table syntax with examples, HTML output and fixes.<\/p>\n","protected":false},"author":1,"featured_media":1130,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-1131","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-writing-text"],"_links":{"self":[{"href":"https:\/\/thenesttools.com\/blog\/wp-json\/wp\/v2\/posts\/1131","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thenesttools.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thenesttools.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thenesttools.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thenesttools.com\/blog\/wp-json\/wp\/v2\/comments?post=1131"}],"version-history":[{"count":2,"href":"https:\/\/thenesttools.com\/blog\/wp-json\/wp\/v2\/posts\/1131\/revisions"}],"predecessor-version":[{"id":1444,"href":"https:\/\/thenesttools.com\/blog\/wp-json\/wp\/v2\/posts\/1131\/revisions\/1444"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thenesttools.com\/blog\/wp-json\/wp\/v2\/media\/1130"}],"wp:attachment":[{"href":"https:\/\/thenesttools.com\/blog\/wp-json\/wp\/v2\/media?parent=1131"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thenesttools.com\/blog\/wp-json\/wp\/v2\/categories?post=1131"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thenesttools.com\/blog\/wp-json\/wp\/v2\/tags?post=1131"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}