# table-column-count Disallow data rows in a GitHub Flavored Markdown table from having more cells than the header row. ## Background In GitHub Flavored Markdown [tables](https://github.github.com/gfm/#tables-extension-), rows should maintain a consistent number of cells. While variations are sometimes tolerated, data rows having *more* cells than the header can lead to lost data or rendering issues. This rule prevents data rows from exceeding the header's column count. ## Rule Details > [!IMPORTANT] > > This rule relies on the `table` AST node, typically available when using a GFM-compatible parser (e.g., `language: "markdown/gfm"`). This rule is triggered if a data row in a GFM table contains more cells than the header row. It does not flag rows with fewer cells than the header. Examples of **incorrect** code for this rule: ```markdown | Head1 | Head2 | | ----- | ----- | | R1C1 | R1C2 | R2C3 | | A | | - | | 1 | 2 | ``` Examples of **correct** code for this rule: ```markdown | Header | Header | | ------ | ------ | | Cell | Cell | | Cell | Cell | | Header | Header | Header | | ------ | ------ | ------ | | Cell | Cell | | | Col A | Col B | Col C | | ----- | ----- | ----- | | 1 | | 3 | | 4 | 5 | | Single Header | | ------------- | | Single Cell | ``` ## Options The following options are available on this rule: * `checkMissingCells: boolean` - When set to `true`, the rule will also flag rows that have fewer cells than the header row. (default: `false`) Examples of **incorrect** code when configured as `"table-column-count": ["error", { checkMissingCells: true }]`: ```markdown | Col A | Col B | Col C | | ----- | ----- | ----- | | 1 | | 3 | | 4 | 5 | ``` ## When Not To Use It If you intentionally create Markdown tables where data rows are expected to contain more cells than the header, and you have a specific (perhaps non-standard) processing or rendering pipeline that handles this scenario correctly, you might choose to disable this rule. However, adhering to this rule is recommended for typical GFM rendering and data consistency. ## Prior Art * [MD056 - table-column-count](https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md056---table-column-count)