Is it possible to center tables in a markdown file?

Meredith picture Meredith · Jun 9, 2014 · Viewed 53k times · Source

I have a table:

    | This | Is | A | Table |
    | :--- | -- | - | ----: |
    | foo  | ba | r | elbaT |

I'd like the table to display in the center of my Markdown file instead of left-aligned. I am not trying to align text, but the entire table itself. Do I need to resort to HTML/CSS to achieve what I want?

This is for an Apiary.io project.

Answer

Baggz picture Baggz · Jul 8, 2014

If you use the standard documentation, use the <center> tag like so.

Blueprint

FORMAT: 1A
HOST: http://www.google.com

# Tables
Notes API is a *short texts saving* service similar to its physical paper presence on your table.

<center>

| Tables   |      Are      |  Cool |
|----------|:-------------:|------:|
| col 1 is |  left-aligned | $1600 |
| col 2 is |    centered   |   $12 |
| col 3 is | right-aligned |    $1 |

</center>

# Group Notes

(...)

Preview


If you use the New Documentation, it's not possible to center a table (since the table takes a full width of the column).

Preview