# Beautiful table samples

I'm interested in learning about some nice-looking table samples. Colors can make a huge difference, and just providing some color to headers, background, or borders can dramatically change presentation. Any samples you're proud to share?

(BTW here's a sample I like, but unfortunately, not TeX...)

-
big-list? CW? But, +1 for the idea. – kan May 4 '13 at 11:07
Great question! I kind of given up on tables in LaTeX, as they tend to be pretty ugly and hard to maintain most of the time. Almost all examples/how-tos about tables produce results which are kind of embarrasing... just look at the first answer, it is ridiculous! But maybe someone will come along and shows how to do "beautiful" and easy to maintain tables. – Simon Lehmann May 4 '13 at 13:01
That green is hard to read. Also, more vspacing may make it look better. – User 17670 May 4 '13 at 18:59
If you want to make a beautiful table that you can actually enjoy with your family and friends, you start by acquiring specimens of fine hardwood, and then apply those woodworking skills. – Kaz May 5 '13 at 2:52
Some very nice css tables are here (Perhaps somebody could "transform" those to LaTeX) – Martin Thoma May 8 '13 at 19:47

I think its worth mentioning the combination tcolorbox-tabularx, which provides an easy way to draw (possibly very much) fancy tables.

Some examples:

\documentclass{article}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{tcolorbox}
\usepackage{tabularx}
\usepackage{array}
\usepackage{colortbl}
\tcbuselibrary{skins}

\newcolumntype{Y}{>{\raggedleft\arraybackslash}X}

\tcbset{tab1/.style={fonttitle=\bfseries\large,fontupper=\normalsize\sffamily,
colback=yellow!10!white,colframe=red!75!black,colbacktitle=Salmon!40!white,
coltitle=black,center title,freelance,frame code={
\foreach \n in {north east,north west,south east,south west}
{\path [fill=red!75!black] (interior.\n) circle (3mm); };},}}

\tcbset{tab2/.style={enhanced,fonttitle=\bfseries,fontupper=\normalsize\sffamily,
colback=yellow!10!white,colframe=red!50!black,colbacktitle=Salmon!40!white,
coltitle=black,center title}}

\begin{document}

\begin{tcolorbox}[tab2,tabularx={X||Y|Y|Y|Y||Y}]
Group & One     & Two     & Three    & Four     & Sum      \\\hline\hline
Red   & 1000.00 & 2000.00 &  3000.00 &  4000.00 & 10000.00 \\\hline
Green & 2000.00 & 3000.00 &  4000.00 &  5000.00 & 14000.00 \\\hline
Blue  & 3000.00 & 4000.00 &  5000.00 &  6000.00 & 18000.00 \\\hline\hline
Sum   & 6000.00 & 9000.00 & 12000.00 & 15000.00 & 42000.00
\end{tcolorbox}

\begin{tcolorbox}[tab2,tabularx={X||Y|Y|Y|Y||Y},title=My table,boxrule=0.5pt]
Group & One     & Two     & Three    & Four     & Sum      \\\hline\hline
Red   & 1000.00 & 2000.00 &  3000.00 &  4000.00 & 10000.00 \\
Green & 2000.00 & 3000.00 &  4000.00 &  5000.00 & 14000.00 \\
Blue  & 3000.00 & 4000.00 &  5000.00 &  6000.00 & 18000.00 \\\hline\hline
Sum   & 6000.00 & 9000.00 & 12000.00 & 15000.00 & 42000.00
\end{tcolorbox}

\begin{tcolorbox}[tab1,tabularx={X||YYYY||Y}]
Group & One     & Two     & Three    & Four     & Sum      \\\hline\hline
Red   & 1000.00 & 2000.00 &  3000.00 &  4000.00 & 10000.00 \\
Green & 2000.00 & 3000.00 &  4000.00 &  5000.00 & 14000.00 \\
Blue  & 3000.00 & 4000.00 &  5000.00 &  6000.00 & 18000.00 \\\hline\hline
Sum   & 6000.00 & 9000.00 & 12000.00 & 15000.00 & 42000.00
\end{tcolorbox}

\end{document}


The are endless customization possibilities, and everything is a matter of writing a custom tcb style that suits your needs. The examples (with some modifications) are taken from the tcolorbox manual, section /tcb/tabularx.

-
My dentist has one of those table s similar to the last one in the waiting room. For documents it's a no-go in my opinion. – percusse May 4 '13 at 12:34
@percusse Well, it depends. Today the word "document" is used in many ways... I see lots of financial reports with extremely fancy tables (much more than that of your dentist - I just remembered one with a deep blue skyline background!) and many people seem to like them so that they're sometimes required. That's why I usually suspend judgment on matters of taste and beauty and just discuss possibilities. – domenico May 4 '13 at 12:44
To quote from the booktabs documentation: 1. Never, ever use vertical lines. 2. Never use double lines. I tend to agree. – Tom Bombadil May 4 '13 at 12:48
@TomBombadil I find the "Never, ever" part to really be nonsense. – domenico May 4 '13 at 13:19
@dcmst Maybe it's harsh to say "Never, ever", but I honestly haven't seen any case where it would produce a nice result. It is highly distasteful imho, as are all the tables above – Xavier May 4 '13 at 18:02

There seems to be a general consensus that booktabs is the way to go, if you want to have a beautifully typeset table. The result is really elegant, but to some it might appear somewhat... Spartan.

Here are a few examples I gathered from the web:

and last but not least, some contributions from our very own site:

And just for completeness' sake, there is the tabu package. I only list it because I subscribe to the opinion that 'beauty is in the eye of the beholder'. Keep in mind, though, that I neither like the results in the documentation (and the documentation itself is IMHO an eye-sore) nor do I recommend using it - it's been reported to be buggy.

(EDIT: A little pun: Using tabu is taboo. :))

Finally, a little example (from a homework on Fourier series and transformation):

## Code

\documentclass{article}
\usepackage{amsfonts}
\usepackage{booktabs}
\usepackage{siunitx}

\begin{document}

\begin{tabular}{SSSSSSSS} \toprule
{$m$} & {$\Re\{\underline{\mathfrak{X}}(m)\}$} & {$-\Im\{\underline{\mathfrak{X}}(m)\}$} & {$\mathfrak{X}(m)$} & {$\frac{\mathfrak{X}(m)}{23}$} & {$A_m$} & {$\varphi(m)\ /\ ^{\circ}$} & {$\varphi_m\ /\ ^{\circ}$} \\ \midrule
1  & 16.128 & +8.872 & 16.128 & 1.402 & 1.373 & -146.6 & -137.6 \\
2  & 3.442  & -2.509 & 3.442  & 0.299 & 0.343 & 133.2  & 152.4  \\
3  & 1.826  & -0.363 & 1.826  & 0.159 & 0.119 & 168.5  & -161.1 \\
4  & 0.993  & -0.429 & 0.993  & 0.086 & 0.08  & 25.6   & 90     \\ \midrule
5  & 1.29   & +0.099 & 1.29   & 0.112 & 0.097 & -175.6 & -114.7 \\
6  & 0.483  & -0.183 & 0.483  & 0.042 & 0.063 & 22.3   & 122.5  \\
7  & 0.766  & -0.475 & 0.766  & 0.067 & 0.039 & 141.6  & -122   \\
8  & 0.624  & +0.365 & 0.624  & 0.054 & 0.04  & -35.7  & 90     \\ \midrule
9  & 0.641  & -0.466 & 0.641  & 0.056 & 0.045 & 133.3  & -106.3 \\
10 & 0.45   & +0.421 & 0.45   & 0.039 & 0.034 & -69.4  & 110.9  \\
11 & 0.598  & -0.597 & 0.598  & 0.052 & 0.025 & 92.3   & -109.3 \\ \bottomrule
\end{tabular}

\end{document}


## Output

-
I just dug up an example I once did, are you okay with me adding it to your post? – Tom Bombadil May 4 '13 at 14:00
@TomBombadil: Sure! Be my guest! :) – Count Zero May 4 '13 at 14:18
+1 for the observation that the tabu package documentation is an eyesore. – Charles Staats May 4 '13 at 14:59
@MarcvanDongen It aligns on the decimalpoint. Probably using the columntype S from siunitx. – Munken May 8 '13 at 8:06
@MarcvanDongen It aligns the ones, the tens etc – Munken May 11 '13 at 20:18

I also favour the guidance given by booktabs, and generally prefer simple, unadorned tables. However, it may be that you want to draw attention to say the highest value for a given row --- e.g., a table of your teaching evaluation scores. (That is, a document that might be able to be 'louder' than something you'd want to put in a book.) In this case, perhaps some colour would be appropriate for an electronic form, but you'd rather just have bold for a printed version. Etc., etc.

Here is a simplified version of what I have done before (meant for fontspec-reliant engines):

\documentclass[12pt, oneside, landscape]{memoir}

\newif\ifblackandwhite
% \blackandwhitetrue

\usepackage{fontspec}%
\defaultfontfeatures{Ligatures=TeX}%
\setmainfont[%
Numbers        = OldStyle ,
ItalicFont     = LinLibertineOI ,
BoldItalicFont = LinLibertineOBI ,
BoldFont       = LinLibertineOB ,
]{LinLibertineO}%

\usepackage[hmargin=2cm,vmargin=2.5cm]{geometry}
\usepackage{etoolbox}
\usepackage{longtable}%
\AtBeginEnvironment{longtable}{%
}

\usepackage{pdflscape}
\usepackage[svgnames]{xcolor}
\usepackage{colortbl}%
\newcommand{\myrowcolour}{\rowcolor[gray]{0.925}}
\usepackage{booktabs}

\ifblackandwhite
\newcommand{\highest}[1]{\textbf{#1}}% == highest score for question
\else
\newcommand{\highest}[1]{\textcolor{Maroon}{\textbf{#1}}}%
\fi

\begin{document}
\thispagestyle{empty}
\parindent0pt
%

\cheading{Fake Course Evaluation Summary for \textsc{course
1234y}}{Sept.\ 2010 --- May 2011}

\begin{longtable}{@{}l rr rr rr rr rr rr}
% pairs: absolute number (percentage)

\toprule%
\centering%
& \multicolumn{2}{c}{{{\bfseries Excellent}}}
& \multicolumn{2}{c}{{{\bfseries Very Good}}}
& \multicolumn{2}{c}{{{\bfseries Good}}}
& \multicolumn{2}{c}{{{\bfseries Average}}}
& \multicolumn{2}{c}{{{\bfseries Poor}}}
& \multicolumn{2}{c}{{{\bfseries Very Poor}}} \\

\cmidrule[0.4pt](r{0.125em}){1-1}%
\cmidrule[0.4pt](lr{0.125em}){2-3}%
\cmidrule[0.4pt](lr{0.125em}){4-5}%
\cmidrule[0.4pt](lr{0.125em}){6-7}%
\cmidrule[0.4pt](lr{0.125em}){8-9}%
\cmidrule[0.4pt](lr{0.125em}){10-11}%
\cmidrule[0.4pt](l{0.25em}){12-13}%
% \midrule

Some question about the Instructor or Course & 2 & (7.14) & 4 &
(14.29) & \highest{12} & \highest{(42.86)} & 4
& (14.29) & 6 & (21.43) & 0 & (0.00) \\

\myrowcolour%
Some question about the Instructor or Course & 3 & (10.71) &
\highest{15} & \highest{(53.57)} & 5 & (17.86) & 5 & (17.86) & 0 &
(0.00) & 0 & (0.00) \\

Some question about the Instructor or Course & 4 & (14.29) & 8 &
(28.57) & \highest{15}
& \highest{(53.57)} & 1 & (3.57) & 0 & (0.00) & 0 & (0.00) \\

\myrowcolour%
Some question about the Instructor or Course & 3 & (10.71) & 8 &
(28.57) & \highest{10} & \highest{(35.71)}
& 5 & (17.86) & 2 & (7.14) & 0 & (0.00) \\

Some question about the Instructor or Course & 6 & (21.43) &
\highest{9} & \highest{(32.14)}
& 4 & (14.29) & \highest{9} & \highest{(32.14)} & 0 & (0.00) & 0 & (0.00) \\

\myrowcolour%
Some question about the Instructor or Course & \highest{10} &
\highest{(35.71)} & \highest{10} & \highest{(35.71)}
& 3 & (10.71) & 5 & (17.86) & 0 & (0.00) & 0 & (0.00) \\

Some question about the Instructor or Course & \highest{12} &
\highest{(42.86)} & \highest{12} & \highest{(42.86)} & 3
& (10.71) & 1 & (3.57) & 0 & (0.00) & 0 & (0.00) \\

\myrowcolour%
Some question about the Instructor or Course & \highest{12} &
\highest{(42.86)} & 3 & (10.71) & 7
& (25.00) & 5 & (17.86) & 1 & (3.57) & 0 & (0.00) \\

Some question about the Instructor or Course & \highest{10} &
\highest{(35.71)} & 6 & (21.43) & 6 & (21.43) & 6 & (21.43)
& 1 & (3.57) & 0 & (0.00) \\

\myrowcolour%
Some question about the Instructor or Course & 5 & (17.86) & 5 &
(17.86) & \highest{12} & \highest{(42.86)} & 2 & (7.14)
& 3 & (10.71) & 1 & (3.57)\\

Some question about the Instructor or Course & 3 & (10.71) & 8 &
(28.57) & \highest{11} & \highest{(39.29)} & 3 & (10.71) & 3 & (10.71)
& 0 & (0.00) \\

\myrowcolour%
Some question about the Instructor or Course & \highest{18} &
\highest{(64.29)}
& 5 & (17.86) & 3 & (10.71) & 1 & (3.57) & 1 & (3.57) & 0 & (0.00) \\

Some question about the Instructor or Course & \highest{15} &
\highest{(53.57)}
& 7 & (25.00) & 2 & (7.14) & 2 & (7.14) & 2 & (7.14) & 0 & (0.00) \\

\myrowcolour%
Some question about the Instructor or Course & 3 & (10.71) &
\highest{13} & \highest{(46.43)} & 4 & (14.29) & 6 & (21.43) & 2
& (7.14) & 0 & (0.00) \\

\bottomrule

\end{longtable}

\end{document}


Remarks: Uncomment \blackandwhitetrue if you want to disable colour. And the \addfontfeature command in \AtBeginEnvironment requires the fontspec package.

-
While I like the overall layout of this table, I'm disturbed by the fact that bold digits are wider that normal digits, and therefore all digits are not aligned in nice, tidy columns. – adl May 8 '13 at 18:41
@adl -- This was a concern of mine as well, but I tried colour without the bold and it just didn't look right to me; worse, if you want a black and white version, there is no good way to make the numbers you are interested in stand out; highlighting individual cell backgrounds, e.g., looks terrible. Remember, too, this is an idea I endorse for less formal documents where you are trying to make something stand out ... plus, given the right-alignment, numbers unaligned only on the lefthand side doesn't seem that severe. Of course, to each their own, etc., etc. – jon May 8 '13 at 18:57
Did you try \npboldmath from the numprint package? It does not seem to work with all fonts, but I have fixed alignment of bold digits in tables with that in the past. – adl May 8 '13 at 19:53
@adl -- (Sorry for the late response; things got busy.) Thanks for the suggestion. I did not know of this package. It doesn't seem to work well with this font (after a quick test): either it switches the font to CM or the parentheses end up sticking out on the right-hand side instead of the left, but I can see the potential. And I will keep it in mind for the future. Also, if you post a modified/improved example using the package, I'd vote for it! – jon May 12 '13 at 0:37

Not a beautiful table yet but I would like some help to make it beautiful :) Here is my attempt at recreating OP's table.

\documentclass{article}
\usepackage[table]{xcolor}
\usepackage[margin=1in]{geometry}
\usepackage{tabularx}
\usepackage{enumitem}

\setlist{nolistsep}
\definecolor{green}{HTML}{66FF66}
\definecolor{myGreen}{HTML}{009900}

\renewcommand{\familydefault}{\sfdefault}
\renewcommand{\arraystretch}{1.5}

\begin{document}

\begin{center}
\begin{tabularx}{\textwidth}[t]{XX}
\arrayrulecolor{green}\hline
\textbf{\textcolor{myGreen}{Goal 1 Eradicate Extreme Poverty}} & \\
\hline
Target 1.A Halve, between 1990 and 2015, the proportion of the people whose income is less than \$1 a day. & \begin{minipage}[t]{\linewidth}% \begin{itemize} \item[1.1] Proportion of population below \$1 purchasing power parity (PPP) a day$^a$
\item[1.2] Poverty Gap ratio [incidence x depth of poverty]
\item[1.3] Share of the poorest quintile in national consumption
\end{itemize}
\end{minipage}\\

\arrayrulecolor{black}\hline

Target 1.B Achieve full and productive employment and decent work for all, including women and young people &
\begin{minipage}[t]{\linewidth}%
\begin{itemize}
\item[1.4] Growth of GDP per person employed
\item[1.5] Employment to population ratio
dec sep align
}
]{ %
Material        & Symbol &  eg  & Type \\
diamond         & C      & 5.46 & i \\
silicon         & Si     & 1.12 & i \\
germanium       & Ge     & 0.67 & i \\
selenium        & Se     & 1.74 & d \\
silicon carbide & SiC 3C & 2.36 & i \\
silicon carbide & SiC 4H & 3.28 & i \\
silicon carbide & SiC 6H & 3.03 & i \\
indium phosphide& InP    & 1.27 & d \\
indium arsenide & InAs   & 0.355& d \\
gallium nitride & GaN    & 3.37 & d \\
gallium arsenide& GaAs   & 1.42 & d \\
aluminium nitride & AlN  & 6.2  & d \\
}
\end{table}
\end{document}


The values are token from wikipedia.

-
I think it should read bandgap in the caption. – Christian Lindig Feb 14 at 12:50

An interesting and simple gallery is presented at Wikibooks - LaTeX/Tables

BTW, my contribution is:

\documentclass{beamer}
\usepackage{booktabs}

\begin{document}

\frame{
\frametitle{Simple Table}

\begin{center}

\begin{tabular}{cccc}
\toprule
Dec        & Bin               & Octal         & Hexa \\
\midrule
\midrule
\midrule
\midrule
\bottomrule
\end{tabular}

\end{center}

}

\end{document}


Result:

-
Er... Most of the examples there look really awful :-( – Stephan Lehmke May 4 '13 at 12:06
For me it looks like a gallery of what is possible - NOT a gallery of what is beautiful. – Hans-Peter E. Kristiansen May 4 '13 at 12:30
No vertical lines + booktabs is the way to go :) – Jubobs May 4 '13 at 12:55

Here is my modest contribution. I created this flat table style using the tabu package and XeLaTeX.

\documentclass{article}
\usepackage{tabu}
\usepackage{longtable}
\usepackage[table]{xcolor}

\definecolor{tableLineOne}{RGB}{245, 245, 245}
\definecolor{tableLineTwo}{RGB}{224, 224, 224}

\rowfont{\leavevmode\color{white}\bfseries}
}

\begin{document}

\taburowcolors[2] 2{tableLineOne .. tableLineTwo}
\tabulinesep = ^4mm_3mm
\everyrow{\tabucline[.4mm  white]{}}

\begin{tabu} to \textwidth {l >{\bfseries}X[r, 1] X[4] l}
& Mot & Définition & \\
...
\end{tabu}
\end{document}


You can find the whole code on my Github repository.

-
! Undefined control sequence. <recently read> \definecolor Something is missing as an import. – Zelphir Mar 9 at 18:12
Sorry, I forgot the \usepackage{xcolor} line... I corrected it! – Thib1235 Mar 11 at 16:57
I think document class is missing? (But I still get an error) (nice table by the way!) – Arne Timperman Mar 11 at 20:08
Sorry, I didn't made it a complete MWE... Now it is one, so you can compile it as is. But if you want a true flat style, you will need to use special fonts using fontspec and XeLaTeX (as I did for this example using Lato). Once again, a complete example can be found on my git repository. – Thib1235 Mar 12 at 13:07
Works perfect now. Thanks – Arne Timperman Mar 12 at 14:41