tableColumnCounts
Reports table rows with column counts that don't match the header.
✅ This rule is included in the md logical presets.
In Markdown flavors that support tables, data rows should not have more cells than the header row. When a data row has more cells than the header, extra cells can lead to lost data or rendering issues. This rule helps ensure table consistency by preventing data rows from exceeding the header’s column count.
Note that rows with fewer cells than the header are allowed, as they render correctly with empty cells.
Examples
Section titled “Examples”| Head1 | Head2 || ----- | ----- | ---- || R1C1 | R1C2 | R1C3 || A || --- | --- || 1 | 2 || Header | Header | Header || ------ | ------ | ------ | ----- || Cell | Cell | Cell | Extra || Header | Header || ------ | ------ || Cell | Cell || Cell | Cell || Header | Header | Header || ------ | ------ | ------ || Cell | Cell | || Col A | Col B | Col C || ----- | ----- | ----- || 1 | | 3 || 4 | 5 |When Not To Use It
Section titled “When Not To Use It”If you have a non-standard Markdown processing pipeline that handles tables with extra cells correctly, you might choose to disable this rule. However, adhering to this rule is recommended for typical GFM rendering and data consistency.
Further Reading
Section titled “Further Reading”Equivalents in Other Linters
Section titled “Equivalents in Other Linters”- ESLint:
markdown/table-column-count - Markdownlint:
table-column-count
Made with ❤️🔥 in Boston by
Josh Goldberg and contributors.