Tags: table, blank_lines
Aliases: blanks-around-tables
This rule checks that tables are surrounded by blank lines above and below them.
"In addition to aesthetic reasons, some parsers will incorrectly parse tables that don't have blank lines before and after them."
Ensuring tables have proper spacing improves:
- Parser compatibility across different Markdown processors
- Document readability and structure
- Consistent formatting standards
Some text
| Header | Header |
| ------ | ------ |
| Cell | Cell |
> BlockquoteSome text
| Header | Header |
| ------ | ------ |
| Cell | Cell |
> Blockquote- Tables must have a blank line above them (unless at the start of the document)
- Tables must have a blank line below them (unless at the end of the document)
- Text immediately following a table can be considered part of the table by some parsers
- This rule improves compatibility with various Markdown parsers
This rule has no specific configuration options.
To fix this issue:
- Add a blank line above the table if there is content before it
- Add a blank line below the table if there is content after it
Example fix:
<!-- Before (violation) -->
Text above table.
| Header | Value |
| ------ | ----- |
| Data | Info |
Text below table.
<!-- After (corrected) -->
Text above table.
| Header | Value |
| ------ | ----- |
| Data | Info |
Text below table.- MD022 - Headings should be surrounded by blank lines: Similar spacing requirements for headings
- MD056 - Table column count: Ensures consistent column counts in tables
- MD055 - Table pipe style: Enforces consistent pipe usage in tables