MD058 - Add blank lines around tables¶
Aliases: blanks-around-tables
What this rule does¶
Ensures tables have blank lines before and after them for better readability and proper rendering.
Why this matters¶
- Clear visual separation: Tables stand out better with surrounding space
- Parser compatibility: Some Markdown parsers require blank lines to recognize tables
- Improved readability: Easier to scan documents and find information
- Consistent formatting: Maintains uniform spacing throughout documents
Examples¶
✅ Correct¶
Here's our team structure:
| Name | Department | Role |
| ------- | ---------- | --------- |
| Alice | Sales | Manager |
| Bob | IT | Developer |
As you can see, we have a diverse team.
❌ Incorrect¶
Here's our team structure:
| Name | Department | Role |
| ------- | ---------- | --------- |
| Alice | Sales | Manager |
| Bob | IT | Developer |
As you can see, we have a diverse team.
🔧 Fixed¶
Here's our team structure:
| Name | Department | Role |
| ------- | ---------- | --------- |
| Alice | Sales | Manager |
| Bob | IT | Developer |
As you can see, we have a diverse team.
Configuration¶
Examples with different settings¶
[MD058]
minimum-before = 2 # Require 2 blank lines before
minimum-after = 1 # Require 1 blank line after
Automatic fixes¶
This rule can automatically fix issues by:
- Adding blank lines before tables (unless at document start)
- Adding blank lines after tables (unless at document end)
- Adding the exact number of blank lines specified in configuration