DevToy

Markdown Tables

Markdown Table Alignment: Left, Center, and Right

Learn how separator-row colons control Markdown table alignment and when each alignment improves technical documentation.

Published July 11, 2026 · Updated July 11, 2026

Markdown table alignment is encoded in the separator row, not in the data cells. A colon at the left edge selects left alignment, colons on both edges select center alignment, and a colon at the right edge selects right alignment.

The three alignment forms

| Name | Status | Duration |
| :--- | :----: | -------: |
| Build | Passed | 42 s |
| Deploy | Waiting | 3 min |

The source above uses :---, :---:, and ---:. The exact number of hyphens is usually flexible, but three or more is the safest portable form. Extra spaces are for source readability and do not normally change the rendered result.

Choose alignment by meaning

Left alignment is the best default for names, descriptions, URLs, and other text. Readers scan text from a consistent starting edge.

Center alignment can work for short categorical values such as yes/no, icons, or build status. Avoid centering long sentences because the changing start position slows scanning.

Right alignment is useful for prices, quantities, durations, percentages, and other comparable numeric-looking values. Markdown renderers still treat the content as text, so right alignment does not provide spreadsheet sorting or arithmetic.

Keep the source maintainable

Padding each cell to an equal source width can make a hand-edited table easier to review, but it is optional. This compact table and a padded table normally render the same:

| Key | Value |
| :-- | ----: |
| A | 10 |

If the values change frequently, use a formatter rather than manually counting spaces. A formatter should calculate display width carefully when the source includes emoji or wide CJK characters; JavaScript string length is not always visual width.

Troubleshoot ignored alignment

If every column renders left-aligned, first check whether the destination supports GitHub Flavored Markdown tables. CommonMark does not define table syntax by itself. Next, check that the separator row has the same number of cells as the header and that no unescaped pipe has created an extra column.

Use the Markdown table editor to switch alignment per column and inspect the generated separator row immediately.

Related guides