Skip to content

Latest commit

 

History

History
53 lines (35 loc) · 1.13 KB

File metadata and controls

53 lines (35 loc) · 1.13 KB

MD056 - Table Column Count

Tags: table
Aliases: table-column-count

Description

This rule checks that all rows in a GitHub Flavored Markdown table have the same number of cells.

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."

Example of a Violation

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

Example of a Correct Table

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

Key Points

  • The header row and delimiter row must have the same number of cells
  • Extra cells are usually not displayed
  • Missing cells create gaps in the table

Configuration

This rule has no specific configuration options.

Fix

To fix this issue:

  1. For missing cells: Add the missing cells to make the row complete
  2. For extra cells: Remove the extra cells or move them to appropriate rows

Related Rules