# 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
```markdown
Here's our team structure:
| Alice | Sales | Manager |
| Bob | IT | Developer |
As you can see, we have a diverse team.
```
### ❌ Incorrect
```markdown
Here's our team structure:
| Alice | Sales | Manager |
| Bob | IT | Developer |
As you can see, we have a diverse team.
```
### 🔧 Fixed
```markdown
Here's our team structure:
| Alice | Sales | Manager |
| Bob | IT | Developer |
As you can see, we have a diverse team.
```
## Configuration
```toml
[MD058]
minimum-before = 1 # Blank lines before table
minimum-after = 1 # Blank lines after table
```
### Examples with different settings
```toml
[MD058]
minimum-before = 2 # Require 2 blank lines before
minimum-after = 1 # Require 1 blank line after
```
## Markdown attributes
Under flavors that support block attribute lists (`hugo`, `mkdocs`, `kramdown`), a
standalone attribute line directly after a table (for example
`{class="a" id="b"}` or a kramdown IAL `{:.class}`) describes the table and is not
treated as content needing a blank line:
```markdown
| Row 1 | Row 1 |
{class="a" id="b"}
```
Set the flavor globally (`flavor = "hugo"`) or per file. In plain CommonMark such a
line is literal text, so this exemption does not apply to the `standard` flavor. See
[Hugo Flavor](flavors/hugo.md).
## 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
## Learn more
- [Markdown Guide: Tables](https://www.markdownguide.org/extended-syntax/#tables)
- [GitHub Flavored Markdown: Tables](https://github.github.com/gfm/#tables-extension-)
## Related rules
- [MD055 - Keep table formatting consistent](md055.md)
- [MD056 - Keep table column count consistent](md056.md)