Using Tables in Markdown

Using Tables in Markdown

Markdown uses | to separate different cells and - to separate the header row from the other rows.

The syntax is as follows:

|  Header   | Header  |
|  ----  | ----  |
| Cell  | Cell |
| Cell  | Cell |

The code above will display as follows:

Using Tables in Markdown0

Setting Alignment

We can set the alignment of the table content:

  • -: sets the content and header to right-align.
  • :- sets the content and header to left-align.
  • :-: sets the content and header to center-align.
| Left Align | Right Align | Center Align |
| :--------- | ----------: | :----------: |
| Cell   | Cell| Cell |
| Cell   | Cell| Cell |

The code above will display as follows:

Using Tables in Markdown0