markdownlint/doc-build/md060.md

1.7 KiB

This rule is triggered when the column separators of a GitHub Flavored Markdown table are used inconsistently.

This rule recognizes three table column styles based on popular use:

Style aligned looks the most like a table:

| Character | Meaning |
| --------- | ------- |
| Y         | Yes     |
| N         | No      |

Style compact uses a single space to pad cell content:

| Character | Meaning |
| --- | --- |
| Y | Yes |
| N | No |

Style tight uses no padding for cell content:

|Character|Meaning|
|---|---|
|Y|Yes|
|N|No|

When this rule's style parameter is set to aligned, compact, or tight, every table must match the corresponding pattern and errors will be reported for any violations. By default, or when the any style is used, each table is analyzed to see if it satisfies any supported style. If so, no errors are reported. If not, errors are be reported for whichever style would produce the fewest errors (i.e., whichever style is the closest match).

Note: Pipe alignment for the aligned style is based on character count, so wide characters and multi-character encodings can produce unexpected results. The following table is correctly aligned based on character count, though some editors render the emoji wider:

| Response | Emoji |
| -------- | ----- |
| Yes      | ✅     |
| No       | ❎     |

Rationale: Consistent formatting makes it easier to understand a document.