A Mutable Log

A blog by Devendra Tewari


Project maintained by tewarid Hosted on GitHub Pages — Theme by mattgraham

Quickly create Markdown table in Visual Studio Code

Here’s a badly formatted table that is syntactically correct

: Table caption

+-+-+
| header 1 | header 2 |
+=+=+
| - row 1, col 1, line 1 | row 1, col 2 |
| - row 1, col 2, line 2 | |
+-+-+
| - row 2, col 1 | row 2, col 2 |
+-+-+

The table uses grid table syntax, but the same procedure can be used with pipe tables.

Use Code’s Table Formatter plugin to format the table so it looks like

: Table caption

+------------------------+--------------+
|        header 1        |   header 2   |
+========================+==============+
| - row 1, col 1, line 1 | row 1, col 2 |
| - row 1, col 2, line 2 |              |
+------------------------+--------------+
| - row 2, col 1         | row 2, col 2 |
+------------------------+--------------+

This is how the grid table should look when rendered to PDF using the eisvogel latex template

Grid Table rendered to PDF by Pandoc