Articles
Published · November 24, 2026

Markdown Table Rows With Missing or Extra Cells

In GitHub Flavored Markdown a short row is padded with empty cells, a long row loses its extras, and a header that doesn't match the delimiter row breaks the table.

Also in: Español中文हिन्दी

Short answer

In GitHub Flavored Markdown, a body row with too few cells gets empty cells added, and a row with too many cells has the extras dropped. The header row is stricter: it must have the same number of cells as the delimiter row underneath it, or the whole thing is not a table. That asymmetry explains most "markdown table missing cells" problems.

The header and delimiter must match

The GFM spec says it plainly: the header row must match the delimiter row in the number of cells. If they differ, a table will not be recognized. Here is the spec's own failing case:

| abc | def |
| --- |
| bar |

The header has two cells and the delimiter row has one, so you don't get a table with a missing column. You get a plain paragraph with the pipes still showing. If a whole table suddenly appears as raw text, count the header and delimiter cells first.

The delimiter row is made of hyphens, with optional colons for alignment. GitHub's table documentation adds that each column in that row needs at least three hyphens.

Rows that are too short or too long

Body rows are more forgiving, with one catch. The spec says the remainder of the table's rows may vary in the number of cells. Fewer cells than the header means empty cells are inserted. More cells means the excess is ignored.

| abc | def |
| --- | --- |
| bar |
| bar | baz | boo |

This renders as a two-column table. The first row is bar plus an empty cell. The second row shows bar and baz, and boo is gone. Nothing warns you. The output gives no hint that a value was dropped.

The short row is easy to spot, because you see a blank. The long row is the dangerous one: the data simply disappears from the page. If you are pasting rows from somewhere else, compare the cell count of every row against the header before you trust the result.

A stray pipe is an extra cell

Pipes separate cells, so a literal pipe in your content counts as a boundary. A cell like a | b becomes two cells, which shifts everything after it and pushes the last value past the end of the row. The fix is to escape the pipe with a backslash. The GFM spec says this works even inside other inline spans, such as code.

Where the table ends

A table has no closing line. According to the spec, it is broken at the first empty line, or at the beginning of another block-level structure. That has a side effect: a plain line directly under the last row is read as one more row.

| abc | def |
| --- | --- |
| bar | baz |
bar

bar

The first bar after the table becomes a row with an empty second cell. Only the bar after the blank line is a paragraph. If a sentence you wrote below a table ends up inside it, add a blank line.

The same care applies above the table. GitHub's docs say you must include a blank line before your table for it to render. And if you indent a table by four spaces, you have probably created an indented code block instead.

Fixing a table that renders wrong

Run through this list in order:

  1. Count the cells in the header row and in the delimiter row. They must be equal.
  2. Count the cells in each body row. Short rows will show blanks, and long rows will lose data.
  3. Look for unescaped pipes inside cells, including in code spans.
  4. Put a blank line before the table and after the last row.
  5. Check that no cell needs a line break or a list. Cells can't hold block elements or span multiple lines.

Leading and trailing pipes are optional, which makes counting harder. a | b has two cells and | a | b | also has two. Adding the outer pipes to every row makes miscounts easier to see. If your data starts as tab-separated text, convert it with a consistent number of columns before you add the pipes.

Other renderers

Everything above describes GFM. Other tools set their own rules. Pandoc's pipe tables, for example, require pipes between all columns, don't allow a missing header (you use blank header cells for a headerless table) and also forbid block elements and multi-line cells. If a table looks right on GitHub and wrong somewhere else, the renderer is the first thing to check.

Checking tables in Carets

Carets is a native Markdown and plain text editor for iPhone, iPad and Mac, and it suits this kind of debugging well. You can keep a table in a plain .md file, see the pipes and hyphens exactly as typed, and fix a stray cell without a rich-text layer hiding the source. Because your notes stay ordinary text files, the same table opens in any other editor too. Get Carets on the App Store.

Frequently Asked Questions

What happens if a Markdown table row has fewer cells than the header?

In GitHub Flavored Markdown the renderer inserts empty cells to fill the row, so the table still shows with blanks at the end of that row.

What happens to extra cells in a Markdown table row?

The GFM spec says the excess is ignored. Those values are dropped from the rendered table without any warning.

Why does my whole Markdown table show as plain text?

Most often the header row and the delimiter row have different cell counts, or there is no blank line before the table. In either case it isn't recognized as a table.

Do all Markdown apps treat mismatched rows the same way?

No. These rules come from the GFM spec. Pandoc and other renderers document their own behavior, so check the one you use.