# MD055 - Table pipe style

## Description

This rule is triggered when table rows in a Markdown file have inconsistent pipe styles.  

In Markdown tables, you can include or omit leading and trailing pipe characters (`|`). This rule enforces a consistent style for these pipes.

## Configuration

The rule can be configured to enforce specific pipe styles:

```json
{
  "MD055": {
    "style": "consistent"
  }
}
```

The `style` parameter can have the following values:

- `consistent` (default): All table rows should use the same style as the first table row
- `leading*and*trailing`: All table rows must have both leading and trailing pipes (`| cell | cell |`)
  - `leading*only`: All table rows must have leading pipes and no trailing pipes (`| cell | cell`) |  |
  - `trailing*only`: All table rows must have trailing pipes and no leading pipes (`cell | cell |`) |  |
  - `no*leading*or*trailing`: All table rows must have neither leading nor trailing pipes (`cell | cell`) |  |  |

## Examples

### Valid

When using default configuration (consistent style):

```markdown
| Header 1 | Header 2 |
| -------- | -------- |
| Cell 1   | Cell 2   |
```

```markdown
Header 1 | Header 2
-------- | --------
Cell 1   | Cell 2
```

When configured to require leading and trailing pipes:

```json
{
  "MD055": {
    "style": "leading*and*trailing"
  }
}
```

```markdown
| Header 1 | Header 2 |
| -------- | -------- |
| Cell 1   | Cell 2   |
```

### Invalid

Using inconsistent styles (with default configuration):

```markdown
| Header 1 | Header 2 |
| -------- | -------- |
Cell 1   | Cell 2
```

When configured to require leading and trailing pipes:

```json
{
  "MD055": {
    "style": "leading*and_trailing"
  }
}
```

```markdown
Header 1 | Header 2
-------- | --------
Cell 1   | Cell 2
```

## Special Cases

- Table syntax within code blocks is ignored
- A table is identified by the presence of a delimiter row (containing dashes and optionally colons)
- The rule processes tables that have at least a header row and a delimiter row

## Rationale

Consistency in table formatting enhances readability and maintainability of Markdown documents.

## Benefits

- Improved document readability
- Consistent table formatting across a project
- Better compatibility with various Markdown parsers

## Related Rules

- [MD056](md056.md) - Table column count should be consistent
- [MD058](md058.md) - Tables should be surrounded by blank lines
