Markdown Tables in Docusaurus: What They Change and When They Work

How Docusaurus turns Markdown pipe tables into HTML, the MDX pitfalls inside cells, accessibility and copy limits, and when another format fits better.

Docusaurus renders tables written in GitHub Flavored Markdown pipe syntax as HTML tables. This review covers what that conversion changes, where it holds up, and when a different format serves readers better.

Short answer: is a Markdown table the right choice?

Pipe tables suit small reference tables with short, single-line cells, such as option lists, feature comparisons or status matrices. Their main benefit is that the source stays readable as plain text and in diffs, while the rendered page gets a real HTML table with header cells. The decisive tradeoff is that cells can hold only inline content. If you need lists, several paragraphs, code blocks, merged cells or a caption, write the table in JSX or HTML, or restructure the content.

Plain text is the better choice in three cases: when the content will be pasted into places that do not render Markdown, such as terminals, commit messages or plain-text email; when the table is really a sequence of steps or a set of definitions; and when the rows are long prose that would wrap into narrow, hard-to-scan columns.

What the conversion actually changes

This is a formatting transformation, not a character substitution. The source file keeps ordinary characters: pipes, hyphens, colons and text. At build time, Docusaurus parses the file through its MDX pipeline, which supports GFM tables, and produces table, thead, tbody, th and td elements. The theme's CSS then controls borders, striping and width. No stored text is swapped for look-alike Unicode glyphs, and reading order is not changed. In this context, "formatting" can mean two different things. Source alignment is the padding that lines up pipes in the file, and the parser ignores it. Rendered presentation is controlled by CSS.

| Setting  | Accepted values | Required |
| :------- | :-------------: | -------: |
| mode     | light, dark     | no       |
| timeout  | seconds         | yes      |

In this example, the first row becomes the header and the second row is the delimiter row. A colon on the left sets left alignment, colons on both sides center the column, and a colon on the right sets right alignment. The extra spaces only help people reading the source. The compact version below renders the same table.

|Setting|Accepted values|Required|
|:-|:-:|-:|
|mode|light, dark|no|
|timeout|seconds|yes|

MDX pitfalls inside table cells

  • Literal pipes: escape a pipe as | so it does not start a new cell. This also applies inside inline code in a cell.
  • Curly braces and angle brackets: in MDX, { starts a JavaScript expression and < can start a JSX tag. Escape them with a backslash or put them in inline code.
  • Line breaks: each row must stay on one source line. Use <br /> for a visible break inside a cell. MDX requires the self-closing form.
  • Block content: lists, fenced code and multiple paragraphs are not allowed in pipe-table cells. Use a JSX or HTML table instead.
  • Spans and captions: pipe syntax has no colspan, no rowspan and no caption.
| Syntax | Meaning |
| --- | --- |
| `a \| b` | pipe inside inline code, escaped |
| `{name}` | braces inside inline code are safe |
| \{name\} | braces escaped in plain text |
| first line<br />second line | line break within one cell |

Recent Docusaurus versions have a configuration setting that parses .md files as CommonMark instead of MDX. For those files, the brace and angle-bracket issues go away. The option name and default differ between versions, so check the documentation for the version you use.

Readability and usability after copying or sharing

Raw source: a pipe table is plain text and can be pasted into any text field without losing characters. It reads well as text when cells are short and poorly when they wrap. Formatters such as Prettier pad columns so the pipes line up, which makes the source easier to read. The cost is that editing one long cell can change every line in that column, which makes diffs noisier. Aligned source can still look ragged in editors when cells contain wide characters such as CJK text or emoji, because displayed width does not match character count.

Rendered page: when a reader copies a rendered table into a spreadsheet, document editor or chat app, the result depends on how that destination handles copied HTML. Check the specific destinations your readers use instead of assuming the structure will survive.

Accessibility: the output is semantic HTML with header cells, so screen readers can announce column headers and move cell by cell. This is the main advantage over ASCII tables in code blocks or box-drawing characters, which assistive technology reads as unstructured characters. Pipe syntax does have limits here. It cannot add a caption or explicit header scope, so tables with two levels of headers should be written in HTML with caption and scope. Cells that contain only a symbol, such as a check mark, may be announced unhelpfully or not at all, so use words such as yes and no. Do not use tables for layout.

Search and editing: cell text is ordinary text in the rendered HTML, so the browser's find-in-page works on it. Whether site search indexes table content depends on the search plugin, so check the plugin's documentation. Editing becomes awkward when cells grow long, because each row has to stay on a single, increasingly long source line.

Narrow screens: wide tables can overflow on phones. Whether the table scrolls horizontally or the page layout breaks depends on the theme's styling. Preview the page at phone width, and keep the number of columns small.

Choosing a format

Format | Best for | Main limitation
Pipe table | Simple grids with short inline cells | No block content, merged cells or caption
JSX or HTML table in MDX | Lists in cells, captions, header scope, spans | Verbose source that is harder to review
List or term-and-explanation headings | Rows that are mostly prose | No side-by-side comparison
Monospaced code block | Output that must look identical when pasted into a terminal | No table structure for screen readers; does not adapt to narrow screens

What this review could not verify

No version-specific measurements, rendering tests or assistive-technology tests were available. This review therefore does not confirm exact theme styling, configuration option names or defaults, clipboard behavior in named applications, or how particular search plugins index tables. Test these against your Docusaurus version, your theme and the destinations your readers use.