Creating tables in markdown

Creating tables in markdown is actually quite simple once you get the hang of it, and can be broken down into easy steps.

Building a basic table

Creating tables in markdown is actually pretty simple, and easily customizable. For the simplest 2x2 table we simply need to create our columns with | and write whatever we want in them. Then we need to follow them by a row of empty columns with three dashes - this is what indicates to markdown this is supposed to be a table.

| col 1 | col 2 |
| ----- | ----- |
| one   | two   |
col 1col 2
onetwo

Expanding your table

From there adding columns and rows should be self explanatory - just add them the same way as the others:

col 1col 2col 3col 4col 5col 6col 7
onetwothreefourfivesixseven
moreabcdef
rowsabcdef

Styling your table

You can also style the table somewhat - the special row is used to align text with a colon :, one on the left aligns text to left, one on the right aligns it to right and double colon centers the text.

column 1column 2column 3
leftrightcenter
xxx
| column 1 | column 2 | column 3 |
| :------- | -------: | :------: |
| left     |    right |  center  |
| x        |        x |    x     |

The usual markdown styling also works in table cells without issues:

column 1column 2column 3
leftrightcenter
xxx

We can even try to do something fun like x's and o's:

| x   |     | o   |
| --- | --- | --- |
| x   | o   |     |
|     | x   | x   |