C.W.K.
Stream
Lesson 01 of 08 · published

Tables — Pipes, Alignment, and Their Limits

~12 min · markdown, gfm, tables

Level 0Plaintext
0 XP0/64 lessons0/12 achievements
0/100 XP to next level100 XP to go0% complete

Pipes draw the columns, dashes draw the header rule

GFM tables are three pieces: a header row, a separator row of dashes, and any number of body rows. Pipes (|) divide columns. Outer pipes are optional; the parser is permissive about whitespace.

Alignment lives in the separator row

  • :--- — left align (default)
  • :---: — center
  • ---: — right align (use this for numeric columns)

What cells can hold

Cells accept inline Markdown: bold, italic, code, links, even inline HTML. Cells cannot hold block content — no headings, lists, fenced code blocks, or paragraphs. If you need that, build the table in HTML instead.

Pipes inside cells

Escape with \|. Or wrap the offending text in <code>|</code> if it's literal pipe code. The renderer respects both.

The 'pretty source' trap: editors and tools auto-align table source by padding cells with spaces. The padding is harmless to the renderer but a nightmare for diffs — every cell-width change rewrites every row. Pick a side: align by hand for stable diffs, or accept that table edits will produce noisy commits.

Code

Minimal valid table·markdown
| Header 1 | Header 2 |
| --- | --- |
| Row 1 | Cell |
| Row 2 | Cell |
Alignment (left / center / right)·markdown
| Name | Status | Count |
| :--- | :---: | ---: |
| alpha | ok | 12 |
| beta | warn | 3,481 |
| gamma | error | 7 |
Inline Markdown inside cells (allowed)·markdown
| Feature | Spec | Notes |
| --- | --- | --- |
| **Bold** | CM | works in cells |
| `code` | CM | works |
| [link](https://example.com) | CM | works |
| ![img](pic.png) | CM | also works |
Escaping pipes in cell content·markdown
| Pattern | Meaning |
| --- | --- |
| `a \| b` | literal pipe in code |
| `a` \| `b` | two code spans, separated |

External links

Exercise

Take a recent CSV (env vars, dependency list, anything tabular) and convert it into a GFM table. Use right-alignment for any numeric column. Try to put a multi-line value or a fenced code block in a cell — confirm the parser refuses it. The lesson is the limit, not the workaround.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.