Creating Tables in Pandoc Markdown

Tables in Pandoc are one of the clearest indications that the people behind Pandoc are not only brilliant, but pragmatic — as opposed to the people at GitHub.

  Name               Occupation
------------------- -------------
  Mr. Rob            Mentor
  Doris              Sculptor

Table: Centered
Centered
Name Occupation
Mr. Rob Mentor
Doris Sculptor

To change the alignment just line up the titles with the edges, or don’t for centering.

Name                Occupation
------------------- -------------
  Mr. Rob            Mentor
  Doris              Sculptor

Table: Left Aligned
Left Aligned
Name Occupation
Mr. Rob Mentor
Doris Sculptor
               Name    Occupation
------------------- -------------
  Mr. Rob            Mentor
  Doris              Sculptor

Table: Right Aligned
Right Aligned
Name Occupation
Mr. Rob Mentor
Doris Sculptor
Name                   Occupation
------------------- -------------
  Mr. Rob            Mentor
  Doris              Sculptor

Table: Left and Right
Left and Right
Name Occupation
Mr. Rob Mentor
Doris Sculptor

Perhaps you have a long value that takes up multiple lines. Here’s an example from my blog when I realized the different types of content nodes that have emerged from my work on skilstak.io:

----------------------------------------------------------------------
 Node Type  Description
----------- ----------------------------------------------------------
    Recipes Descriptions in step by step form that fufill a specific
            need. These have been
            popularized by O'Reilly's many tech books with
            this title and the responses to Quora and StackExchange
            questions.

  Tutorials Guided learning projects with specific steps,
            prequisite tasks and other projects, and references.

      Tasks Specific tasks that are slightly larger than can be
            included in any specfic tutorial or recipe.

      Terms Terms and concept definitions much like in a glossary.

       Info Stuff like prices and policy.

       FAQs Specific questions with specific answers. This often
            overlaps with *Info*.

 References Lists of links to other content nodes or places within
            them.

       Logs Things like blogs and news and change logs.
----------------------------------------------------------------------
Table: Emerging Content Node Types
Emerging Content Node Types
Node Type Description
Recipes Descriptions in step by step form that fufill a specific need. These have been popularized by O’Reilly’s many tech books with this title and the responses to Quora and StackExchange questions.
Tutorials Guided learning projects with specific steps, prequisite tasks and other projects, and references.
Tasks Specific tasks that are slightly larger than can be included in any specfic tutorial or recipe.
Terms Terms and concept definitions much like in a glossary.
Info Stuff like prices and policy.
FAQs Specific questions with specific answers. This often overlaps with Info.
References Lists of links to other content nodes or places within them.
Logs Things like blogs and news and change logs.

You almost always want headers just for clarity, but if for some reason you don’t just add a bottom line as well as the starting one on top.

--- ---
 a   A
 b   B 
 c   C 
--- ---
Table: No Headers
No Headers
a A
b B
c C

GitHub Flavored Markdown Tables are Garbage

💢 The GitHub Flavored Markdown syntax for tables is completely moronic. What’s worse is all the “utilities” that popped up to create them because the syntax is so ridiculously bad. Obviously whoever invented them doesn’t actually write a lot of it. It they did they would have arrived at the very elegant solution Pandoc provides.

GFM tables might be more common than Pandoc but they is so completely stupid that anyone wanting tables should abandon GFM completely and render their own HTML with Pandoc. In fact, this one specific point led me to create my own static site generator instead of depend on anyone rendering the HTML besides me.