Skip to content

MD056 - Keep table column count consistent

Aliases: table-column-count

What this rule does

Ensures every row in a table has the same number of columns as the header row, preventing broken or misaligned tables.

Why this matters

  • Proper rendering: Tables with inconsistent columns may display incorrectly or break entirely
  • Data integrity: Missing or extra columns can indicate missing or misplaced data
  • Professional appearance: Well-formed tables look organized and trustworthy
  • Parser compatibility: Many Markdown parsers require consistent column counts

Examples

✅ Correct

| Name     | Department | Years |
| -------- | ---------- | ----- |
| Alice    | Sales      | 5     |
| Bob      | Marketing  | 3     |
| Charlie  | IT         | 7     |

✅ Correct (with empty cells)

| Name     | Department | Years |
| -------- | ---------- | ----- |
| Alice    | Sales      | 5     |
| Bob      |            | 3     |
| Charlie  | IT         |       |

❌ Incorrect

| Name     | Department | Years |
| -------- | ---------- | ----- |
| Alice    | Sales      | 5     |
| Bob      | Marketing  |       | Extra data |
| Charlie  | IT         |

🔧 Fixed

| Name     | Department | Years |
| -------- | ---------- | ----- |
| Alice    | Sales      | 5     |
| Bob      | Marketing  |       | Extra data |
| Charlie  | IT         |       |

Charlie's row is padded. Bob's row is still reported, because removing its extra cell would delete Extra data: add a header column or remove the cell yourself.

Configuration

This rule has no configuration options.

Automatic fixes

This rule fixes what it can without losing text:

  • Rows with too few columns get empty cells, which is how they render anyway
  • Extra cells that are empty are removed
  • A delimiter row is matched to the header: extra cells are removed and missing ones are added as ---

A row whose extra cells contain text is reported but never changed, since only you can tell whether the header is missing a column or the row has a stray pipe.

Learn more