[GH-ISSUE #90] Table alignment checks #1921

Closed
opened 2026-03-07 20:02:48 +03:00 by kerem · 2 comments
Owner

Originally created by @lloeki on GitHub (Nov 3, 2017).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/90

This could produce an alignment warning, enticing people to draw text-clean tables:

aze | qsd
------|----
123 | 456
Originally created by @lloeki on GitHub (Nov 3, 2017). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/90 This could produce an alignment warning, enticing people to draw text-clean tables: ``` aze | qsd ------|---- 123 | 456 ```
kerem 2026-03-07 20:02:48 +03:00
Author
Owner

@swirle13 commented on GitHub (May 27, 2025):

Markdown All In One does this with their extension (https://github.com/yzhang-gh/vscode-markdown/blob/master/src/tableFormatter.ts) but I much prefer Markdownlint as my formatter of choice. Only thing missing from this extension is this table formatting. I'm hoping this feature could be added. I may try to take a stab at it outside of work hours.

<!-- gh-comment-id:2913945033 --> @swirle13 commented on GitHub (May 27, 2025): Markdown All In One does this with their extension (https://github.com/yzhang-gh/vscode-markdown/blob/master/src/tableFormatter.ts) but I much prefer Markdownlint as my formatter of choice. Only thing missing from this extension is this table formatting. I'm hoping this feature could be added. I may try to take a stab at it outside of work hours.
Author
Owner

@swirle13 commented on GitHub (Mar 5, 2026):

Just to clarify, markdownlint doesn't actually format the tables, is that correct? I perused the commit and it doesn't appear to add any formatting of tables, just alerting on table style violations.

I'm integrating this into a pre-commit hook and I'm getting lots of table column style failures and I was hoping by using markdownlint-cli2 with a fix flag would fix these issues, but it doesn't seem to have the functionality to do so. The file I linked performs actual table formatting, which I was hoping similar functionality would be brought into this codebase.

I've created a custom rule that works from testing locally, which I've just published to npm: https://www.npmjs.com/package/markdownlint-rule-table-format

repo here: https://github.com/swirle13/markdownlint-rule-table-format

<!-- gh-comment-id:4001522005 --> @swirle13 commented on GitHub (Mar 5, 2026): Just to clarify, markdownlint doesn't actually format the tables, is that correct? I perused the commit and it doesn't appear to add any formatting of tables, just alerting on table style violations. I'm integrating this into a pre-commit hook and I'm getting lots of table column style failures and I was hoping by using markdownlint-cli2 with a fix flag would fix these issues, but it doesn't seem to have the functionality to do so. The file I linked performs actual table formatting, which I was hoping similar functionality would be brought into this codebase. I've created a custom rule that works from testing locally, which I've just published to npm: https://www.npmjs.com/package/markdownlint-rule-table-format repo here: https://github.com/swirle13/markdownlint-rule-table-format
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/markdownlint#1921
No description provided.