Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to left align a whole table in markdown (pandoc)?

How do you left align an entire table in Markdown/Pandoc? I know about different ways of specifying tables and how alignment of columns are done, but I cannot find a way to shift the table from center aligned to left aligned (have even tryed embedding <div style="float: left>..</div> which didn't work). Do I have to switch to LaTeX to do this? I will export to pdf later on, if that makes a difference.

like image 523
fileunderwater Avatar asked Jan 10 '14 11:01

fileunderwater


People also ask

How do I center align a table in markdown?

Tables are center-aligned by default when they are included in a table environment (i.e., when the table has a caption). If you do not want to center a table, use the argument centering = FALSE.

How do you left align a table in latex?

You can also use r to align the text to the right and l for left alignment. This will insert a horizontal line on top of the table and at the bottom too. There is no restriction on the number of times you can use \hline .


1 Answers

I now found a solution to this problem at tex.stackexchange.com. Apparently pandoc inserts \centering for every float in the document. This can be cancelled by inserting \let\centering\relax in a custom preample to pandoc (as pandoc argument -H custompreample.tex). The link also describes more detailed ways to for example define different floats for tables and figures.

like image 109
fileunderwater Avatar answered Sep 27 '22 20:09

fileunderwater