Line breaks and multiline cells in Markdown tables

How to put a line break or multiple lines in a Markdown table cell, what the common <br> workaround changes, and when a plain-text alternative is the safer choice.

Standard Markdown table syntax has no built-in way to start a new line inside a cell. Each table row has to stay on one physical line of source text. A common workaround is to insert an HTML line break tag. Whether that workaround fits your situation depends on where the table will be rendered, who will read or edit the source, and what happens to the content after it is copied. This review explains what the technique changes, where it tends to hold up, and when a plain-text alternative works better.

Short answer: is the <br> workaround suitable?

For tables rendered by a platform that allows inline HTML, adding <br> inside a cell is usually the simplest way to get a visible line break. You keep the table compact and readable when rendered, and you avoid restructuring the content.

The main tradeoff is portability. The break only exists if the renderer interprets HTML. Anywhere that shows raw source or strips HTML, the reader sees either a literal "<br>" or text run together. The source also becomes harder to scan and edit, because one long line now carries several logical lines.

Plain text, or a different structure, is preferable when:

  • The destination does not render HTML, or you cannot confirm that it does.
  • People will mostly read the raw Markdown, for example in a plain-text editor, a terminal or a diff view.
  • A cell needs several paragraphs, a long list or code. That content usually reads better as a section or list below the table.
  • The table will be converted to other formats, such as plain text or spreadsheets, where an HTML tag has no meaning.

Why a normal newline breaks the table

In the widely used pipe-table syntax, popularized by GitHub Flavored Markdown, each line of source is one row. A table ends at a blank line or at the start of another block element. If you press Enter in the middle of a cell, you have not created a new line in that cell. You have ended the row, and the remaining text is parsed as a new row or as ordinary text outside the table.

Familiar ways to force a line break elsewhere in Markdown also fail inside table cells. These include ending a line with two spaces or a backslash. Both rely on the next line continuing the same paragraph, and a table row cannot continue onto the next line.

What the transformation actually changes

This is a formatting transformation, not a change to the words themselves. It helps to separate two layers:

  • Stored characters: the source file gains the literal characters <br> (or <br/>) between the pieces of text. No newline character is stored inside the cell.
  • Visual presentation: a renderer that accepts the tag displays a line break at that point. A renderer that does not accept it shows the tag as text or removes it.

The terms used in searches can mean different things. A "new line" or "newline" usually refers to a newline character in the text. A "line break" is the visual result. A "multiline cell" can mean either a cell with several lines displayed, or a cell whose source spans several lines. Pipe tables only support the first meaning, and only through workarounds like <br>.

Common approaches compared

Approach | What you write | Where it works | Main limitation
HTML <br> in a pipe table | Text<br>more text in one cell | Renderers that allow inline HTML | Shows as a literal tag or disappears where HTML is not rendered
HTML list inside a cell | <ul><li>…</li></ul> in one cell | Renderers that allow these HTML elements | Long and hard to edit in source; support for block-level HTML in cells varies
Full HTML table | <table>, <tr>, <td> markup | Renderers that allow HTML tables | Loses Markdown readability in source
Pandoc grid tables | Box-drawn table with cell content over several source lines | Pandoc and tools built on it | Not part of GitHub Flavored Markdown; other renderers will not parse it
Restructure the content | Short cell text plus a list or notes below the table | Any Markdown renderer | Details move out of the table

Pandoc also has a separate "multiline tables" syntax. Despite the name, it is mainly for cells whose text wraps across source lines. Grid tables are the Pandoc option documented to hold block content such as several paragraphs or lists in a cell. Check the documentation of the converter you actually use before you rely on either syntax.

Example source

A pipe table that uses <br> for line breaks and a simple list inside a cell:

| Option   | Details                                   |
|----------|-------------------------------------------|
| Basic    | First line<br>Second line                 |
| Advanced | - Item one<br>- Item two<br>- Item three  |

In the second row, the hyphens are ordinary characters. They will not become a real bulleted list, because Markdown list syntax is not parsed inside a pipe-table cell. If a renderer supports it, an HTML list gives true list structure. The cost is noisier source.

If the cell text contains a pipe character, escape it as | so it is not read as a column separator. Some renderers have extra rules for pipes inside inline code within tables, so test that case in your target environment.

Copying, sharing and accessibility

Behavior after copying depends on what is copied:

  • Copying the Markdown source carries the literal <br> tags. Pasting into another Markdown tool works only if that tool also renders HTML. Elsewhere, the tags appear as text.
  • Copying the rendered table, for example from a web page, often produces real line breaks or separate lines in the pasted text. The exact result depends on the browser and the receiving application, and it was not tested for this review.
  • Pasting into chat apps, email clients or issue trackers that use their own Markdown variant may strip the tags or show them. Check each destination you care about rather than assuming one working example applies to all.

For accessibility, a <br> inside a cell still leaves the cell as one table cell, so table navigation stays the same. How a particular screen reader announces the break, or whether it pauses there, was not verified for this review and may differ between products. Be cautious when line breaks are the only thing separating distinct items. A short separator in the text, such as a semicolon or a label, keeps the meaning clear even if the break is dropped or not announced.

Search and editing are affected in smaller ways. Text on either side of a <br> sits on the same source line, so a plain-text search of the source sees it as one string with a tag in the middle. Diffs and reviews of long rows become harder to read, because any change to a cell shows up as a change to the whole row.

When to provide a plain-text equivalent

Provide plain text, or restructure the table, when the content must survive environments you do not control. Examples include a README that may be viewed in a terminal, documentation exported to several formats, and text pasted into tools with unknown Markdown support. Write each cell so it still makes sense if the breaks are lost, for example "Step 1: install; Step 2: configure" rather than relying on layout alone.

Gaps in this review

No product-specific test results, version details or platform documentation were provided for this article. The guidance above reflects how standard pipe-table syntax and inline HTML generally work. Support for <br>, HTML lists and alternative table syntaxes varies by renderer and by its security settings. Before relying on a technique, preview it in the exact platform or converter where readers will see it.