Skip to main content

Align content in Markdown tables

You can set the align attribute on a table column in Markdown by using a colon in the header row separator.

A typical table looks like this:

| A   | B   | C   |
| --- | --- | --- |
|     |     |     |

To align the content, add colons to the separator row—:- for left, :-: for center, and -: for right:

| A    |   B    |     C |
| :--- | :----: | ----: |
| Left | Center | Right |

That Markdown will render a table with the align attribute set on the header and body cells:

ABC
LeftCenterRight

Read more about Markdown tables