Skip to content

Instantly share code, notes, and snippets.

@justineuro
Last active June 28, 2018 09:04
Show Gist options
  • Save justineuro/236c48c3a2cbd67cbd505b9463d09720 to your computer and use it in GitHub Desktop.
Save justineuro/236c48c3a2cbd67cbd505b9463d09720 to your computer and use it in GitHub Desktop.
Markdown Tables on GitHub: Empty Cells

Creating Markdown Tables on GitHub: Empty Cells

Simply leave the cell empty if that cell is not the first cell of a row.
If the empty cell is the first cell of a row, render the cell empty by including an empty link, i.e., []() within the desired empty cell.
In the Table 1 example below, Cells 1,2 and 3,2 are left blank, hence, rendered empty. Cells 3,2, and 4,2 are rendered as empty cells with []() although we could have left Cell 4,2 empty.
In the Table 2 example, which has an error, note how leaving Cell 2,1 empty renders an incorrect table.

Hence the markup:

### Table 1
Header 1 | Header 2
---------|---------
Cell 1,1 | 
 []()    | Cell 2,2
Cell 3,1 | 
Cell 4,1 | []()

would give:

Table 1

Header 1 Header 2
Cell 1,1
Cell 2,2
Cell 3,1
Cell 4,1

While the markup:

### Table 2 (`w/ error`)
Header 1 | Header 2
---------|---------
Cell 1,1 |   
         | Cell 2,2
Cell 3,1 | 
Cell 4,1 | []()

would give:

Table 2 (w/ error)

Header 1 Header 2
Cell 1,1
     | Cell 2,2

Cell 3,1 | Cell 4,1 |

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment