How to Write Tables in Markdown

Basic table creation with Markdown

* This page contains promotional content

Table notation in Markdown

Basically all you do is separate things with |

Basic form

|Header 1|Header 2|Header 3|
|-------|-------|-------|
|Item 1|Item 2|Item 3|
Header 1Header 2Header 3
Item 1Item 2Item 3
  • The first row is the header The header always seems to end up bold
  • The second row is the separator that sets the attributes Any number of - seems to be fine, but four or more is probably better
  • From the third row onwards, you just keep adding as many items and contents as you like

Alignment

When you want the headers and items left aligned, right aligned or centred

|Header 1|Header 2|Header 3|
|:------|:-----:|------:|
|Left|Center|Right|
Header 1Header 2Header 3
LeftCenterRight
  • One thing to watch out for is that it applies to the whole column, so if you want to apply it individually, insert an HTML tag

Merging and splitting

Unfortunately Markdown does not seem to be able to build complex tables such as ones with merged or split cells, so write them in HTML

The table below is written directly with table tags

Item
ContentContentContentContent
ContentContent
ContentContentContent
Content

See also