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.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>