Skip to content

MD056 - table-column-count

Description

This rule is triggered when a GitHub Flavored Markdown table does not have the same number of cells in every row. Each row should have the same number of cells as the header row. Note that a table's header row and its delimiter row must have the same number of cells or it will not be recognized as a table (per the GFM specification).

Rationale

Extra cells in a row are usually not shown, so their data is lost. Missing cells in a row create holes in the table and suggest an omission. Consistent column counts ensure all data is visible and properly aligned.

Examples

Invalid

# Invalid Table

| Header | Header |
| ------ | ------ |
| Cell   | Cell   |
| Cell   |
| Cell   | Cell   | Cell   |

Valid

# Valid Table

| Header | Header |
| ------ | ------ |
| Cell   | Cell   |
| Cell   | Cell   |
| Cell   | Cell   |