markdownlint/doc/md060.md
David Anson a7b36a5b1b
Some checks failed
Checkers / linkcheck (push) Has been cancelled
Checkers / spellcheck (push) Has been cancelled
CI / build (20, macos-latest) (push) Has been cancelled
CI / build (20, ubuntu-latest) (push) Has been cancelled
CI / build (20, windows-latest) (push) Has been cancelled
CI / build (22, macos-latest) (push) Has been cancelled
CI / build (22, ubuntu-latest) (push) Has been cancelled
CI / build (22, windows-latest) (push) Has been cancelled
CI / build (24, macos-latest) (push) Has been cancelled
CI / build (24, ubuntu-latest) (push) Has been cancelled
CI / build (24, windows-latest) (push) Has been cancelled
CI / pnpm (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
TestRepos / build (latest, ubuntu-latest) (push) Has been cancelled
UpdateTestRepos / update (push) Has been cancelled
wip
2025-11-24 14:59:08 -08:00

2.5 KiB

MD060 - Table column style

Tags: table

Aliases: table-column-style

Parameters:

  • style: Table column style (string, default any, values aligned / any / compact / tight)

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 ensures table delimiters are vertically aligned and orderly:

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

The aligned style ignores cell content, so the following is also valid:

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

Style compact avoids extra padding with a single space around cell content:

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

Style tight uses no padding at all 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 any violations will be reported for. By default, or when the any style is used, each table is analyzed to see if it satisfies any supported style. If so, no violations are reported. If not, violations are be reported for whichever style would produce the fewest issues (i.e., whichever style is the closest match).

Note: Delimiter placement for the aligned style is based on visual appearance and not character count. Because editors typically render emoji and CJK characters at twice the width of Latin characters, this rule takes that into account for tables using the aligned style. The following table is therefore correctly formatted and will appear aligned in most editors and monospaced fonts:

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

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