Marking up Tables in LaTeX

Recently I’ve been writing a LOT of LaTeX for slides (using powerdot) and I’m trying to collect some of what I’ve learned here so I can refer back to it later (and so it’ll be in words I can understand, some LaTeX documentation is slightly too academic for my tastes!)

I find the default formatting for table output in LaTeX can look a bit … squashed, so I always precede my tables with this:

\renewcommand{\arraystretch}{1.5}

To define a table, you use the tabular keyword and define your columns using l, r or c depending whether you want each one right, left or centre justified:

\begin{tabular}{l | l}


The individual table rows are then added as newlines, with & between columns and \\ at the end of each line:

            Provider & The app with the interesting data\\
            Consumer & The app that wants the data\\ 
            User & Who the data belongs to\\
            Token & Random string\\
            Secret & Another random string, linked to a token\\
            Verifier & Another random string\\ 

And the output:

The result is better spaced and easier to see, which is exactly what I need when people might be reading it from a long way away!

Leave a Reply

Please use [code] and [/code] around any source code you wish to share.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Find out more about Webmentions.)