Markdown Table Alignment: Left, Right, and Center Columns
Control Markdown table columns: align left, right, or center with colons, plus fixes for column width and multi-line cell limits.

To align a Markdown table column, put a colon in the delimiter row (the row of dashes under your header). Colon on the left aligns left, colon on the right aligns right, and a colon on both sides centers the column. That single row controls every column below it, and it is the only alignment control standard Markdown gives you.
Here is the shape of it before we break each piece down:
| Item | Price | Stock |
| :------- | ----: | :----: |
| Keyboard | 45.00 | 12 |
| Mouse | 19.99 | 240 |
That table renders with the first column left-aligned, the price right-aligned, and stock centered.
How column alignment works with the delimiter row
The delimiter row is the second line of any Markdown table, the one made of dashes. It does two jobs at once. It tells the parser “this is a real table, and the row above is the header,” and it sets the alignment for each column with colons.
Each cell in that row maps to one column. So a three-column table needs three delimiter cells, split by pipes. The dashes themselves are just filler. You need at least one dash per cell, but --- or ---------- render identically. What matters is where the colons sit.
If you leave the colons out entirely, columns fall back to the default, which is left alignment in almost every renderer (GitHub, CommonMark, most static site generators). The colons only matter when you want to override that default.
One thing that trips people up: alignment lives only in the delimiter row. You cannot align a single cell differently from its column. If you want the price column right-aligned, every price cell is right-aligned. There is no per-cell override in standard Markdown.
Left, right, and center alignment syntax
Here are the four cases with the exact colon placement. This is the core of how you align a Markdown table.
Left align (colon on the left, or no colon at all):
| Name |
| :------- |
| Seginim |
Right align (colon on the right, good for numbers and currency):
| Amount |
| -----: |
| 45.00 |
Center align (colon on both sides):
| Status |
| :----: |
| Live |
Default (no colons, renders left in most parsers):
| Note |
| ---- |
| Beta |
A practical habit: right-align anything numeric so the digits line up by place value, and left-align text. Center alignment reads well for short status labels or single-word tags, but it makes longer text harder to scan, so use it sparingly.
You do not need to line up the pipes in your source for it to render. |:--|:-:|--:| works exactly the same as a neatly padded version. Padding is purely for your own readability while editing.
Why you can’t set column width in standard Markdown
You cannot set Markdown table column width in the standard syntax. There is no attribute for it, no percentage, no pixel value. Column width is decided by whatever renders the table: the browser’s table layout, the CSS on the page, or the theme of your Markdown editor. The width sizes to fit the content and the container.
This surprises people coming from HTML or a word processor, where you drag a column edge. Markdown deliberately leaves presentation to the layer underneath it. The syntax describes structure (header, rows, alignment) and stops there. That is also why the same table can look narrow on GitHub and wide in your notes app: different CSS, same Markdown.
Workarounds for wide columns and long content
If a column is too wide or too cramped, you have a few real options depending on where the table lives.
- Shorten the content. The cheapest fix. Trim long cell text, abbreviate headers, or move a verbose column into a footnote or a paragraph below the table.
- Add your own CSS. On a site you control, target the table with a class or a wrapping selector and set
table-layout: fixedplus explicitwidthormax-widthon the columns. This is the reliable way to pin widths. - Wrap the table in a scroll container. For a table that is genuinely wide, put it inside a
divwithoverflow-x: autoso it scrolls sideways instead of blowing out the page on mobile. - Pad a header to hint a minimum width. A loose trick: a longer header cell nudges a column wider because the column must fit its widest cell. It is fragile and not real control, but it costs nothing.
None of these change the Markdown syntax itself. Width is a styling concern, so the fix always lives in CSS or in editing the content, never in the table markup.
Handling line breaks and multiple lines inside a cell
A Markdown table cell cannot hold a real paragraph break or a literal newline. The pipe-delimited row format means one row is one line, so pressing Enter inside a cell breaks the table. If you paste multi-line content straight into a cell, the table stops rendering at that point.
To put multiple lines inside a single cell, use the HTML break tag instead of a real newline:
| Feature | Notes |
| :------ | :----------------------------- |
| Export | CSV and JSON.<br>PDF is beta. |
The <br> forces a visual line break while keeping everything on one physical source line, so the table still parses. Most renderers that support GitHub Flavored Markdown accept it. You can also use <br> to stack short items, though it starts to feel like a hack past two or three lines.
If a cell needs a bulleted list, several paragraphs, or a code block, the table is the wrong container. That content wants an HTML table or a different layout entirely, which we get to below. For anything you are generating from a spreadsheet, it is easier to keep cells short and let a converter build the markup for you. Our CSV to Markdown converter turns spreadsheet rows into a clean table and handles the pipe escaping, so you are not hand-typing delimiter rows for a 40-row table.
Why alignment sometimes doesn’t render
If your Markdown table is not rendering or the alignment is ignored, the cause is almost always one of these small formatting issues:
- A missing blank line above the table. Many parsers need an empty line between a paragraph and the table. Without it, the whole block is treated as plain text.
- The wrong number of pipes. Each row, including the delimiter, must have the same column count. A row with an extra or missing pipe can drop cells or break the table.
- No colons in the delimiter row. If alignment is being ignored, check that the colons are actually on the dash row, not the header row. Colons anywhere else do nothing.
- A stray space breaking a colon.
- :(with a space before the colon) is not the same as-:. The colon has to touch the dashes with no space between. - A literal newline inside a cell. As above, a real line break splits the row and stops rendering.
- A renderer that does not support tables. Plain CommonMark without the GitHub Flavored Markdown extension does not do tables at all. Basic Markdown never had them, so the syntax is an extension your tool may not enable.
Work through that list top to bottom and you will catch most broken tables. When in doubt, count the pipes in your header, delimiter, and first data row: all three numbers should match. If you are still fighting the source, it can help to review how to make a table in Markdown from the ground up rather than patching a broken one.
When to switch to HTML tables instead
Reach for a real HTML table when you hit the wall of what Markdown can express. That means merged cells (colspan or rowspan), per-cell alignment, guaranteed column widths, or rich content like lists and multiple paragraphs inside a cell. Markdown has none of those, and no amount of colons or <br> tags will fake them cleanly.
The trade-off is verbosity and readability. An HTML table is far more code and much harder to edit by hand, which is the whole reason Markdown tables exist. So keep Markdown for the common case (simple rows, one line per cell, left or right or center alignment) and drop to HTML only for the layout it genuinely cannot do. If you are weighing the two formats more broadly, Markdown versus HTML covers where each one earns its place.
FAQ
How do I center a column in a Markdown table?
Put a colon on both sides of the dashes in the delimiter row for that column: | :----: |. Every cell in that column then centers. There is no way to center just one cell.
Can I set a fixed column width in Markdown?
No. Standard Markdown has no width syntax. Width is controlled by the renderer and its CSS. On a site you control, add table-layout: fixed and a width in CSS, or shorten the cell content.
How do I add a line break inside a table cell?
Use <br> where you want the break. A real newline (pressing Enter) breaks the row and stops the table from rendering, so <br> is the only safe way to stack lines in one cell.
Why is my Markdown table not rendering? Usually a missing blank line above the table, mismatched pipe counts between rows, or a renderer without table support. Check that your header, delimiter, and data rows all have the same number of pipes, and confirm your tool supports GitHub Flavored Markdown.
If you build tables often, learning the full Markdown syntax guide once will save you from re-checking colon placement every time.