Create and format tables in Markdown
How Markdown tables work, what table formatters change, and when a Markdown table survives copying, sharing and screen readers, or when plain text works better.
Is a Markdown table the right choice?
A Markdown table is a good fit for small, structured comparisons in documents that a Markdown-aware platform will render, such as README files, wikis and documentation sites. The main benefit is that one source serves two purposes. The text stays readable as plain characters, and a supporting renderer turns it into a real HTML table with header cells.
The decisive tradeoff is that tables are not part of the original Markdown syntax or the core CommonMark specification. They are an extension, so whether your table renders depends on the destination. The syntax is also deliberately limited. It has no merged cells, no multi-paragraph cells, no column widths, no captions and no row headers.
Plain text is the better choice in three cases: the destination does not render Markdown tables, each cell would hold long prose, or the content has only one or two dimensions and works just as well as a list.
How Markdown table syntax works
The most widely used form is the pipe table, as defined in GitHub Flavored Markdown (GFM). PHP Markdown Extra, MultiMarkdown and Pandoc support similar pipe tables, with some differences in their details. A minimal table has a header row, a delimiter row and one or more body rows.
| Item | Qty | Price |
| :----- | :-: | ----: |
| Apples | 3 | 1.20 |
| Pears | 12 | 0.85 |
In a GFM renderer, the example above becomes a table with three columns. Item is left-aligned, Qty is centered and Price is right-aligned. The core rules are:
- Pipes separate cells. Leading and trailing pipes are optional in GFM, but including them makes the source easier to read and parse.
- The delimiter row sits under the header and contains only hyphens, with optional colons. GFM accepts a single hyphen per cell, but three is the common convention and the safer choice across parsers.
- Colons set alignment: a colon on the left for left alignment, on both sides for center, on the right for right alignment.
- In GFM, the header row must have the same number of cells as the delimiter row, or the block is not recognized as a table. Body rows with fewer cells are padded with empty cells, and extra cells are ignored.
- Inline formatting such as emphasis, bold, inline code and links works inside cells. Block content such as lists, headings or multiple paragraphs does not.
- To show a literal pipe inside a cell, escape it with a backslash. In GFM this applies even inside inline code.
- A line break within a cell requires an HTML tag such as br. That works only where the renderer allows inline HTML.
| Operator | Meaning |
| -------- | ------- |
| `a \| b` | a or b |
In GFM, the cell in the example above renders as the inline code a | b. Without the backslash, the pipe would split the cell in two.
What formatting a table actually changes
It helps to separate two layers: the characters stored in the source file, and the visual presentation produced by the renderer.
Table formatters change the stored characters. These can be editor commands, plugins that reformat on save, or standalone tools. They pad cells with spaces so the pipes line up, and they normalize the delimiter row. They do not change the rendered result, because the renderer trims surrounding whitespace from each cell. The compact version below renders the same as the padded example earlier in a GFM renderer.
|Item|Qty|Price|
|:-|:-:|-:|
|Apples|3|1.20|
|Pears|12|0.85|
Because padding is a real change to the file, adding one longer value can cause a formatter to rewrite every line of the table. That makes version-control diffs noisier. Some teams accept this for readable source, and others keep tables compact on purpose.
Alignment colons change only presentation. They tell the renderer how to align text in each column. The data itself is not altered.
Visual alignment in the source has a limit with some characters. Formatters that count characters or code points can misalign columns when cells contain wide characters, combining marks or multi-code-point emoji. Many CJK characters and emoji take up two columns in a monospace font. Combining marks take up none. A single emoji can be built from several code points. The table still renders correctly. Only the plain-text view looks uneven.
Searches for a Markdown "font" or "fancy text" can lead to tools that swap in look-alike Unicode characters, such as mathematical bold letters, instead of using Markdown emphasis. Inside a table, these are different characters from ordinary letters, not styling. They may not match normal searches. Screen readers may announce them unpredictably. Sorting or filtering the data later can also break. For bold or italic text in a cell, use Markdown's own emphasis markers.
Will the table stay readable after copying or sharing?
The answer depends on what gets copied (source or rendered output) and where it goes.
- Source pasted into a place that does not render Markdown: the pipes and hyphens appear as literal characters. A padded table stays fairly readable. A compact one is harder to scan.
- Source pasted into a renderer that supports Markdown but not tables, such as a strict CommonMark renderer: the consecutive lines are treated as one paragraph, so the table can collapse into a single run-on line of pipes and text.
- Rendered table copied from a web page: what reaches the clipboard depends on the browser and the receiving application. Some destinations may receive a structured table, and others flattened or tab-separated text. No destination tests were supplied for this review, so check your own target before relying on it.
- Messaging and comment tools: Markdown support varies widely, and support for bold or italics does not imply support for tables. Check the destination's documentation.
Accessibility: when a supporting renderer outputs HTML, the header row becomes header cells. That gives assistive technology a standard way to connect body cells to their column headings. Markdown cannot express captions, row headers or explicit header scope, so a complex table that needs these must be written in HTML instead. Leaving header cells empty also removes the labels that make table navigation useful. No scoped screen-reader testing was supplied here. If accessibility matters for your audience, test with the assistive technology those readers use.
Reading order and editing: tables are read row by row. Using them for page layout, or to place unrelated content side by side, produces a confusing reading order. Text in cells is ordinary text, so it can be searched and edited as usual. Wide tables, however, are awkward to edit in source form, especially when cells contain escaped pipes.
Provide a plain-text equivalent when the content goes somewhere that may not render tables. Examples include email to unknown clients, plain-text form fields, commit messages and many chat tools. A small table can usually be rewritten as labeled lines without losing meaning:
Apples: quantity 3, price 1.20
Pears: quantity 12, price 0.85
Markdown table or plain-text alternative
| Situation | Markdown table | Plain-text list or lines |
| Destination renders GFM-style tables | Recommended | Works, but loses scanning by column |
| Destination renders Markdown without tables | Collapses into a run-on paragraph | Recommended |
| Destination shows raw text only | Readable if padded, cluttered if compact | Recommended |
| Cells need lists, paragraphs or merged cells | Not supported; use HTML | Often clearer |
| Short, multi-column comparison | Recommended | Becomes repetitive |
| Version-controlled file with frequent edits | Fine; padding increases diff noise | Smaller diffs |
What to check in a table formatting tool
- Which dialect the output targets, and whether it matches your renderer.
- Whether pipes in imported data, such as pasted spreadsheet or CSV content, are escaped automatically.
- Whether padding is optional, so you can choose between aligned source and smaller diffs.
- How it handles wide characters, combining marks and emoji when aligning columns.
- For online tools, what the published policy says about the data you paste. Do not assume how data is handled from the tool's appearance or marketing, and avoid pasting sensitive content when no policy is stated.
Evidence and gaps
This review is based on the documented syntax of GFM-style pipe tables and on general rendering principles. No product-specific tests, clipboard tests across destinations or screen-reader tests were available. Claims about how a particular platform, application or assistive technology handles tables should be confirmed against that product's documentation or a test in your own environment.