Skip to content

Markdown Table Cheatsheet

By MarkdownTables.com editorial teamUpdated

The core GitHub Flavored Markdown table syntax on one screen, followed by copyable snippets for alignment, widths, cell content, merged cells and templates. Each snippet links to its full guide.

Core syntax

Basic table
Markdown
| Name | Role     |
| ---- | -------- |
| Ada  | Engineer |
Preview
NameRole
AdaEngineer

Header row, delimiter row, data rows. Full syntax

Open in editor : Basic table
Alignment
Markdown
| Left | Center | Right |
| :--- | :----: | ----: |
| a    |   b    |  1.50 |
Preview
LeftCenterRight
ab1.50

:--- left, :---: center, ---: right. Alignment

Open in editor : Alignment
Escape a pipe
Markdown
| Expression | Meaning |
| ---------- | ------- |
| `a \| b`    | OR      |
Preview
ExpressionMeaning
a | bOR

Write \|, even inside backticks. Escaping pipes

Open in editor : Escape a pipe
Line break in a cell
Markdown
| Task | Steps            |
| ---- | ---------------- |
| Ship | Tag<br>Publish   |
Preview
TaskSteps
ShipTag
Publish
Inline formatting
Markdown
| Style  | Result                      |
| ------ | --------------------------- |
| Text   | **bold** *italic* ~~old~~   |
| Code   | `npm install`               |
| Link   | [Docs](https://example.com) |
Preview
StyleResult
Textbold italic old
Codenpm install
LinkDocs

Inline Markdown works; block Markdown does not. Formatting

Open in editor : Inline formatting

All snippets

Showing 26 of 26 snippets

Standard GFM Pipe Table

Core

The standard GitHub Flavored Markdown table structure with header row, delimiter row, and data cells.

Markdown
| Header 1 | Header 2 | Header 3 |
| :------- | :------- | :------- |
| Row 1 A  | Row 1 B  | Row 1 C  |
| Row 2 A  | Row 2 B  | Row 2 C  |

Borderless Outer Pipes

Core

In strict GFM, outer boundary pipes on edges are optional, though including them is recommended for portability.

Markdown
Item | Qty | Price
--- | --- | ---
Keyboard | 2 | $89
Mouse | 5 | $25

Delimiter Row Rules

Core

GFM needs only one hyphen per delimiter cell (|-|-| is valid), but three (---) is the common convention for readability and linter compatibility. Extra dashes are fine for padding raw markdown.

Markdown
| Left | Center | Right | Padded Visual |
| :--- | :--: | ---: | :------------------------- |
| Valid | Valid | Valid | Spaces inside delimiters ok |

Left, Center, & Right Alignments

Alignment

Colons in the delimiter line dictate column alignments (:--- for left, :---: for center, ---: for right).

Markdown
| Left Aligned | Centered Status | Right (Numbers) |
| :----------- | :-------------: | --------------: |
| Server Alpha |     ONLINE      |           99.9% |
| Server Beta  |     PENDING     |           85.4% |
| Server Gamma |     OFFLINE     |            0.0% |

Decimal & Financial Right-Alignment

Alignment

Right-align numbers, percentages, and currencies so decimal places and values line up vertically.

Markdown
| Asset Class | Allocation | Price (USD) | Change (24h) |
| :---------- | ---------: | ----------: | -----------: |
| US Equities |      45.0% |   $4,850.25 |       +1.24% |
| Global Bond |      35.0% |     $102.80 |       -0.15% |
| Cash Reserves |    20.0% |      $1.00 |        0.00% |

Column Width with an HTML Table

Alignment

Pipe tables have no width syntax, and a <th> inside a pipe header cell nests one header in another. Write the table in HTML with <th width="N">. GitHub keeps the attribute but auto-sizes tables, so it may be ignored there.

HTML + Markdown
<table>
  <tr>
    <th width="120">ID</th>
    <th width="320">Feature</th>
  </tr>
  <tr>
    <td>F-101</td>
    <td>Real-time table diffing</td>
  </tr>
</table>

Minimum Width with Non-Breaking Spaces

Alignment

Pad header or cell text with &nbsp; entities to force browsers to allocate minimum column width.

Markdown
| Column&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Compact Data |
| :---------------------------------- | :----------- |
| Enforces at least 180px width | Normal width |

Multi-Line Cells via HTML <br>

Formatting

Markdown tables do not support physical newlines. Use <br> or <br/> to break text onto multiple lines.

Markdown
| Step | Action Steps & Terminal Commands |
| :--: | :-------------------------------- |
| 1    | Clone repository<br>`git clone https://github.com/repo` |
| 2    | Install dependencies<br>`npm install`<br>`npm run build` |

In-Cell Bulleted & Numbered Lists

Formatting

Standard markdown bullet asterisks fail inside tables. Use Unicode bullets (•) paired with <br> tags.

Markdown
| Plan Tier | Included Core Features |
| :-------- | :--------------------- |
| Starter   | • 100 client-side exports<br>• Standard GFM parser |
| Pro       | • Unlimited table conversions<br>• Custom CSS templates<br>• Priority SLA |

Inline Styles (Bold, Italic, Strikethrough)

Formatting

Markdown inline formatting works directly between cell boundary pipes.

Markdown
| Style Type | Markdown Syntax | Rendered Appearance |
| :--------- | :-------------- | :------------------ |
| Bold Text  | `**Important**` | **Important** |
| Italicized | `*Optional*`   | *Optional* |
| Strikethrough | `~~Deprecated~~` | ~~Deprecated~~ |
| Combined   | `***High Priority***` | ***High Priority*** |

Colored Text on GitHub (Math, Emoji, Badges)

Formatting

GitHub strips style attributes, so <span style="color:…"> shows as plain text there. GitHub-compatible options: LaTeX math with \color, colored emoji, or shields.io badge images. Inline styles only work on renderers that allow them (for example VS Code preview).

Markdown
| Service | Status (math) | Status (emoji) | Badge |
| :------ | :------------ | :------------: | :---- |
| Auth API | $\color{green}{\text{Operational}}$ | 🟢 | ![up](https://img.shields.io/badge/status-up-brightgreen) |
| Payments | $\color{orange}{\text{Degraded}}$ | 🟡 | ![degraded](https://img.shields.io/badge/status-degraded-orange) |
| Search | $\color{red}{\text{Outage}}$ | 🔴 | ![down](https://img.shields.io/badge/status-down-red) |

Font Size & Fine Print (<small>)

Formatting

Reduce text size in dense tables with the HTML <small> tag where HTML is allowed. GitHub strips inline style attributes, so font-size styles do not work there.

Markdown
| Metric Name | Value | Regulatory Compliance Notes |
| :---------- | :---: | :--------------------------- |
| Annual ARR  | $4.2M | <small>*Audited by GAAP standards. Subject to revision.*</small> |
| Churn Rate  | 1.8%  | <small>*Calculated over trailing 12-month average.*</small> |

Escaping Pipes in Text, Code & Wikilinks

Formatting

Escape literal pipes with backslashes (\|), even inside code spans (`a \| b`), since GFM splits cells before parsing code. Use &#124; in plain text, or Obsidian [[Note\|Alias]].

Markdown
| Context | Markdown Syntax | Output |
| :------ | :-------------- | :----- |
| Plain Text | `A \| B` | A \| B |
| Code Span | `grep -E "a\|b"` | `grep -E "a\|b"` |
| HTML Entity | `&#124;` | &#124; |
| Obsidian | `[[Note\|Custom Alias]]` | Custom Alias |

LaTeX Math Formulas in Tables ($...$)

Formatting

Use LaTeX inline math ($...$). Prevent math pipes from breaking columns using \vert and \mid.

Markdown
| Metric Name | LaTeX Formula | Description |
| :---------- | :------------ | :---------- |
| MAE Loss    | $\mathcal{L} = \frac{1}{n}\sum\lvert y - \hat{y}\rvert$ | Mean Absolute Error |
| Bayes Rule  | $P(A \mid B) = \frac{P(B \mid A)P(A)}{P(B)}$ | Conditional Probability |

Subscripts, Superscripts & Footnotes

Formatting

Embed chemical formulas, mathematical powers, and footnote citations in cells.

Markdown
| Molecule | Chemical Formula | Molar Mass | Source Citation |
| :------- | :--------------- | :--------- | :-------------: |
| Water    | H<sub>2</sub>O    | 18.01 g/mol | [^1] |
| Sulfate  | SO<sub>4</sub><sup>2-</sup> | 96.06 g/mol | [^2] |

[^1]: NIST Chemistry WebBook (2026).
[^2]: Atmospheric baseline measurements.

Collapsible Accordion Table (<details>)

Advanced

Wrap large tables inside HTML5 <details>. CRITICAL: Leave an empty blank line after </summary>!

HTML + Markdown
<details>
<summary>▶ <b>Click to view Benchmark Results</b> (4 models)</summary>

| Model Name | Latency (p95) | Accuracy | Memory |
| :--------- | :-----------: | :------: | :----: |
| Model A    | 14 ms         | 98.2%    | 4.2 GB |
| Model B    | 22 ms         | 99.1%    | 8.0 GB |

</details>

Merged Cells (Colspan & Rowspan)

Advanced

GFM pipe tables lack native cell merging. Use an HTML <table> hybrid for true multi-column/row spans.

HTML + Markdown
<table>
  <tr>
    <th rowspan="2">Region</th>
    <th colspan="2">Revenue Results</th>
  </tr>
  <tr>
    <th>Q1</th>
    <th>Q2</th>
  </tr>
  <tr>
    <td>Global</td>
    <td>$1.2M</td>
    <td>$1.8M</td>
  </tr>
</table>

Visual Pseudo-Merging with Arrows

Advanced

Simulate merged columns and rows in pure Markdown using directional arrows (→, ↓) and ditto marks (^).

Markdown
| Environment | Database Host | Read Replica | Cache Cluster |
| :---------- | :-----------: | :----------: | :-----------: |
| Production  | PostgreSQL 16 |      →       |   Redis 7.2   |
| Staging     | PostgreSQL 16 |     None     |   Redis 7.2   |
| Dev / Local |  Docker Local |      →       |       →       |

Headerless Table (&nbsp; Hack)

Advanced

GFM strictly requires a header row. Insert non-breaking spaces (&nbsp;) to create visually blank headers.

Markdown
| &nbsp; | &nbsp; |
| :--- | :--- |
| **API Endpoint** | `https://api.markdowntables.com/v1` |
| **Auth Mode**    | Bearer Token (JWT) |
| **Rate Limit**   | 100 requests per minute |

Table Captions, Titles & Legends

Advanced

Attach titles using Pandoc (: Caption) syntax, semantic HTML <caption>, or bold markdown titles.

Markdown
**Table 1: Infrastructure Resource Allocation**

| Node Name | vCPU | RAM | Storage |
| :-------- | :--: | :-- | :------ |
| worker-01 |  16  | 64 GB | NVMe 1TB |
| worker-02 |  32  | 128 GB| NVMe 2TB |

*Source: Cloud orchestration inventory metrics.*

Clickable Shields.io Badges & Avatars

Advanced

Embed clickable status badges and team avatars sized with the width attribute (GitHub strips style attributes, so CSS such as border-radius is ignored).

Markdown
| Package | Status Badge | Maintainer Avatar |
| :------ | :----------: | :---------------: |
| core    | [![npm](https://img.shields.io/npm/v/markdowntables)](https://npmjs.com) | <img src="https://github.com/daxesh.png" width="36" alt="daxesh"> |

Sprint Checklist & Task Matrix

Templates

Task-list syntax ([ ] and [x]) stays literal text inside table cells, so use Unicode ballot boxes (☑ ☐) or emoji (✅ ⬜) for status columns. Clickable checkboxes only work in task lists outside the table.

Markdown
| Status | Milestone / Deliverable | Target Date | Assignee |
| :----: | :---------------------- | :---------: | :------- |
| ☑ | Alpha Release & Architecture Review | 2026-Q1 | Daxesh |
| ☑ | Beta User Testing & Bug Fixes | 2026-Q2 | Team |
| ☐ | Production Launch & Global CDN | 2026-Q3 | DevOps |

REST API Endpoint Specification

Templates

Industry blueprint for documenting REST API parameters, HTTP methods, and data types.

Markdown
| Endpoint | Method | Parameter | Type | Required | Description |
| :------- | :----: | :-------- | :--: | :------: | :---------- |
| `/v1/users` | `GET` | `limit` | int | No | Maximum records to return (1-100) |
| `/v1/users` | `POST` | `email` | str | Yes | Valid user contact email address |
| `/v1/auth` | `POST` | `token` | str | Yes | Bearer authorization secret |

SaaS Feature & Plan Comparison Matrix

Templates

High-contrast comparison matrix for SaaS pricing tiers, feature limits, and SLA levels.

Markdown
| Feature / Tier | Free ($0) | Pro ($29/mo) | Enterprise |
| :------------- | :-------: | :----------: | :--------: |
| Active Seats   | 1 User    | Up to 10     | Unlimited  |
| Table Exports  | 100/mo    | Unlimited    | Unlimited  |
| Real-time Sync | ❌        | ✅           | ✅         |
| SLA Support    | Community | Email (24h)  | 99.9% 1-Hr |

Python Pandas & Tabulate Generator

Templates

Generate GitHub-compliant Markdown tables programmatically in Python using Pandas or Tabulate.

Python
import pandas as pd

df = pd.DataFrame({
    "Framework": ["Next.js", "React", "Vue"],
    "Type": ["Full-Stack", "Library", "Progressive"],
    "Stars": ["120k", "225k", "208k"]
})

# Export to GitHub Flavored Markdown
print(df.to_markdown(index=False, tablefmt="github"))

Need the full explanation?

The Markdown table syntax guide covers the structure rules, alignment, cell content, platform support and accessibility, with a guide for each topic.

Read the syntax guide

Cheatsheet FAQ

What is the basic Markdown table syntax?

A header row of cells separated by pipes, a delimiter row with at least one hyphen per column (| --- | --- |), then one line per data row. Leave a blank line before and after the table. See the syntax guide.

How do I color text in a Markdown table on GitHub?

GitHub strips style attributes, so <span style="color:red"> shows as plain text. Use math with $\color{red}{\text{Failed}}$, colored emoji such as 🔴 🟢, or shields.io badge images. See text formatting.

How do I put a list or a line break inside a cell?

Use <br> between lines, or an HTML list on one line (<ul><li>One</li><li>Two</li></ul>) on GitHub and GitLab. Markdown list syntax (- item) does not work inside a cell. See line breaks.

How do I print this cheatsheet or save it as a PDF?

Use the Print / PDF button or your browser’s print command. The printed version shows every snippet as code in a single column, without site navigation. Choose “Save as PDF” as the printer to get a file.