How to Make Awesome Latex Tables

by Jess K on September 13, 2013

Sometimes the normal tables in LaTeX just don’t do it for you.  You want to do something fancier or customize the table in a way that you just can’t do using the normal tabular environment.  This is why I like using the Deluxetable style in latex.  Deluxetable makes tables that are more flexible, and overall have a nicer look than normal latex tables. Deluxetable can handle multi-page tables, footnoting, multi-column headers, and much more that the tabular environment can’t do. Below is an example of a cool table with some nice features that I made for my thesis using the Deluxetable style package:

Some nice features of this table: adjustable table width, 1 or 2 line column headings are aligned at center, 1 or 2 line data sets are aligned at center, adjustable heights of rows.

Below is the code used to generate the above table.  Note that you need the file deluxetable.sty and the package nicefrac:

\begin{deluxetable}{cccccccc}
\tabletypesize{\footnotesize}
\tablecolumns{8}
\tablewidth{0pt}
\tablecaption{ Cross-correlation Fit Details \label{table:results1}}
\tablehead{
\colhead{QSO} \vspace{-0.2cm} & \colhead{$R$ Range} & & & & & \colhead{Separation} & \colhead{Result}\\ \vspace{-0.2cm}
& &  \colhead{$\langle f \rangle$} & \colhead{$r_0$} &  \colhead{$\gamma$} & $W$ & & \\
\colhead{Division} & \colhead{(Mpc/h)} & \colhead{} & \colhead{} & \colhead{} & & \colhead{(\%)} & \colhead{Strength}}
\startdata
\vspace{-0.2cm} \nicefrac{1}{3} Bright & & $4.24 \cdot 10^{-4}$ & 6.19 & & 96.97 & & \\ \vspace{-0.2cm}
& [0.3,3] & & & 1.77 & &  96.7 & 1.9$\sigma$ \\
\nicefrac{2}{3} Dim & & $4.26 \cdot 10^{-4}$ & 4.48 & & 52.77
\enddata
\vspace{-0.8cm}
\tablecomments{Luminosity dependent quasar clustering using a cross-correlation technique between CS82 galaxies ($M &lt; 23.5$) and SDSS, BOSS, and 2SLAQ quasars \hbox{($0.5 < z < 1.0$)}.  The quasars were broken up into the \nicefrac{1}{3} brightest and \nicefrac{2}{3} dimmest, and a cross-correlation function was calculated between a range of \hbox{$[0.3-3.0]$ Mpc}.  A power-law fit to the data of the form $\xi(r) = (r_0 / r)^\gamma$ found that $\gamma = 1.77$ and $r_0 = 6.19$ for the bright sample and $r_0 = 4.48$ for the dim sample.}
\end{deluxetable}

Here is an example of a more complicated Deluxetable from Charles Danforth at University of Colorado.

{ 2 comments… read them below or add one }

1 Camila May 17, 2014 at 4:30 pm

Many thanks for your example! I was trying to center the caption text and this works excellent :)!

Reply

2 Klaus Lang October 19, 2014 at 4:15 pm

Hello, I get probs with your example with Lyx on Windows 64 bit and Miktex.
Deluxetable.sty seems to be fully ignored
Do I really need deluxetable.sty and where I have to move it to.
Isn´t it sufficient to take aastex?

Reply

{ 1 trackback }

Leave a Comment

Previous post:

Next post: