share
TeX - LaTeXBeautiful table samples
[+280] [15] please delete me
[2013-05-04 11:03:22]
[ tables tabu big-list ]
[ https://tex.stackexchange.com/questions/112343/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...)

enter image description here

(13) 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
(3) That green is hard to read. Also, more vspacing may make it look better. - User 17670
(44) 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
Thanks everybody for the great answers. I feel there is no one right answer. Many great examples are popping up. I just let popular vote decide the order. And everybody who has another sample to share, feel free to add it to the list. - please delete me
(2) Some very nice css tables are here (Perhaps somebody could "transform" those to LaTeX) - Martin Thoma
[+143] [2013-05-04 13:27:07] Count Zero

There seems to be a general consensus that booktabs [1] 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:

Some contributions from our very own site:

And just for completeness' sake, there is the tabu [4] 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 [5].

(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

enter image description here

[1] http://ctan.org/pkg/booktabs
[2] https://tex.stackexchange.com/questions/28087/example-of-fancy-table-using-tikz-package
[3] https://tex.stackexchange.com/questions/94032/fancy-tables-in-latex
[4] http://ctan.org/pkg/tabu
[5] https://tex.stackexchange.com/a/48282/7417

(10) +1 for the observation that the tabu package documentation is an eyesore. - Charles Staats
@MarcvanDongen It aligns on the decimalpoint. Probably using the columntype S from siunitx. - Munken
@MarcvanDongen It aligns the ones, the tens etc - Munken
Thanks for the templates! I especially like the ones you get with the PERL module. But I don't know PERL, is there a way to get the LaTeX code for those tables? - a_bet
(1) What does S in the tabular argument mean? - Gaslight Deceive Subvert
tug.org and metacpan.org links are dead - Dimitri Lesnoff
1
[+101] [2013-05-04 12:12:05] d-cmst

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}

enter image description here

The are almost 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 [1], section /tcb/tabularx.

[1] http://ctan.mirror.garr.it/mirrors/CTAN/macros/latex/contrib/tcolorbox/tcolorbox.pdf

(29) 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
(13) @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. - d-cmst
(35) To quote from the booktabs documentation: 1. Never, ever use vertical lines. 2. Never use double lines. I tend to agree. - Tom Bombadil
(35) @TomBombadil I find the "Never, ever" part to really be nonsense. - d-cmst
(13) @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
(8) @Xavier, It's not harsh, it's utter nonsense. Without "maybes". Or what, should we force people to draw only the tables you (or the author of booktabs) like? Seriously? Please, stop this nonsense... - d-cmst
(3) @dcmst Well, I disagree. There is a difference between commonly agreed-upon rules amongst experts (which you are free to ignore of course) and nonsense. Nobody ever intended to prevent you from using vertical lines, double lines, word underlines and 10+ typefaces in a single documents. - Xavier
(2) @Xavier There is no such "experts agreement", maybe that is your wishful thinking. Simon Fear himself says in the doc file that "not everyone follows this second guideline" (referring to doublelines). This is a matter of taste. What is so difficult for you to understand about matters of taste? There are no experts on matters of taste. - d-cmst
(1) @dcmst It's not that it's difficult to understand, it's that it's not fully correct. Sure taste is subjective, but it doesn't preclude observations on what is considered more or less beautiful by a majority of people. Why else would certain paintings be worth more than others? Or certain restaurants more pricey? - Xavier
(2) @Xavier you're missing the point. If it is a matter of taste -as you just conceded- nor you, nor Simon Fear, nor anybody else are entitled to say: "Never, ever..." You don't say "never, ever" when talking about tastes. You say "I'd do in a different way", "I don't like it", etc. These are observations. On the other hand "never, ever" introduces an absolute statement, not an observation, which has no meaning (its plain nonsense) when talking about tastes. Also, where is the majority here? Show appropriate studies please. - d-cmst
(2) @percusse I was talking about financial reports made with LaTeX. I don't care if you don't care about some LaTeX use cases, that is your problem, really. Anyway, if you have some arguments (I'm not sure about what, but, anyway...) please make your comment self contained or insert a specific reference to where they can be found. - d-cmst
@dcmst It looks like morbusg was faster than me to quote Robert Bringhurst. But maybe that's not an appropriate reference for you... - Xavier
(3) @Xavier Those are just statements, not arguments! He is telling us what he likes, cool stuff. Should we make a law from it? No. Is there a proved objective argument? No. Should we force people to think like him? No. Can we say that based on his statements we are entitled to say "never ever"" draw tables in a different way? No! Now, please, if you have other "arguments" like those of this guy please add more, this is super funny stuff :D - d-cmst
(1) @dcmst As I wrote earlier, there are different tastes, but there also something called beauty as recognized by experts and the majority of people. As for lack of arguments, I bet you haven't even read Robert Bringhurst's book... You are asking for references and arguments, and once you get one quoting the #1 reference book in typography, you discard it without a hint of an effort to understand. - Xavier
2
[+82] [2013-05-04 18:19:28] jon

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}{%
  \addfontfeature{RawFeature=+tnum;-onum}%  <--- requires LuaTeX
}

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

\ifblackandwhite
  \newcommand{\cheading}[2]{\textbf{#1\hfill #2}}
  \newcommand{\highest}[1]{\textbf{#1}}% == highest score for question
\else
  \newcommand{\cheading}[2]{\textcolor{Maroon}{\textbf{#1\hfill #2}}}
  \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
\endhead


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.

example table


(7) 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
@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
(2) 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
(1) @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
(1) Re zebra tables – I prefer to mark every third line because I have less ink in the table (imo a good thing in itself) and I can however easily follow a row because the row to follow ① is marked, ② it's below a marked row or ③ is above a marked row. The only drawback, in my experience, is that while people always recognize the 01010 pattern as a visual aid, sometimes they attribute extra meaning to a 010010010 pattern and ask "Why some lines are highlighted?" - gboffi
3
[+62] [2013-05-04 13:02:42] Jeel Shah

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
\item[1.6] Proportion of employed people living below \$1 (PP) a day
\item[1.7] Proportion of own-account and contribution family workers in total employment
\end{itemize} 
\end{minipage}\\

\hline

Target 1.C Halve, between 1990 and 2015, the proportion of people who suffer from hunger &
\begin{minipage}[t]{\linewidth}%
\begin{itemize}
\item[1.8] Prevalence of underweight children under five years of age
\item[1.9] Proportion of population below minimum level of dietary energy consumption
\end{itemize}
\end{minipage}\\

\arrayrulecolor{green}\hline
\textbf{\textcolor{myGreen}{Goal 2 Achieve universal primary education}} \\
\hline

Target 2.A Ensure that by 2015 children everywhere, boy and girls alike, will be able to complete a full course of primary schooling. &
\begin{minipage}[t]{\linewidth}%
\begin{itemize}
\item[2.1] Net enrollment ratio in primary education
\item[2.2] Proportion of pupils starting grade 1 who reach last grade of primary education
\item[2.3] Literacy rate of 15- to 24-year-olds, women and men
\end{itemize}
\end{minipage}\\

\hline
\multicolumn{2}{l}{%
\textbf{\textcolor{myGreen}{Goal 3 Promote gender equality and empower women}}} \\
\hline

Target 3.A Eliminate gender disparity in primary and secondary education, preferably by 2005, and in all levels of education no later than 2015 &
\begin{minipage}[t]{\linewidth}%
\begin{itemize}
\item[3.1] Ratios of girls to boys in primary, secondary and tertiary education
\item[3.2] Share of women in wage employment in the non-agricultural sector.
\end{itemize} 
\end{minipage}
\end{tabularx}
\end{center}

\end{document}

enter image description here


(3) Can't read the green. - User 17670
(3) @User17670 I have updated the table. The picture is not high quality but if you compile it yourself, the headers are readable. - Jeel Shah
(1) @gekkostate I made some changes to your code. Hope that's fine. :) - hpesoj626
(1) Love it, thanks for your contribution. - Gigili
4
[+43] [2013-05-05 10:53:24] morbusg

One often-quoted typographer, Robert Bringhurst [1], says about tables in his book The Elements of Typographic Style, pp. 70–71:

Edit tables with the same attention given to text, and set them as text to be read.

...

  1. All text should be horizontal, or in the rare cases oblique. Setting column heads vertically as a space-saving measure is quite feasible if the text is in Japanese or Chinese, but not if it is written in the Latin alphabet.
  2. Letterforms too small or too condensed for comfortable reading are not part of the solution.
  3. There should be a minimum amount of furniture (rules, boxes, dots and other guiderails for traveling through typographic space) and a maximum amount of information.
  4. Rules, tint blocks or other guides and dividers, where they are necessary at all, should run in the predominant reading direction: vertically in the case of lists, indices and some numerical tables, and horizontally otherwise.
  5. A rule located at the edge of a table, separating the first or final column from the adjacent empty space, ordinarily serves no function.
  6. A table, like any other text in multiple columns, must contain within itself an adequate amount of white space.

On that third point, Edward Tufte [2] has coined the term “data-ink ratio” to mean (reconstructed from The Visual Display of Quantitative Information, p. 93):

enter image description here

Following that, you can usually replace any rules you use in tables with just whitespace. Likewise, when displaying larger amounts of data in a table, instead of “ zebra-striping [3]” rows, you can add vertical whitespace (or background color) between groups of rows of, for example, 3 or 5 (provided the rows are evenly divisible) to make it easier to follow the information.

Here's an example set in baselinegrid I've made for a cheatsheet for a game (It's in plain XeTeX-format, so compile with xetex):

\def\mainfont{Myriad Pro}
\font\bodyfont="\mainfont:mapping=tex-text;+onum" at 8bp \let\tenrm\bodyfont
\font\boldfont="\mainfont/B" at 8bp \let\tenbf\boldfont
\bodyfont

\baselineskip=10bp
\smallskipamount=\baselineskip
\medskipamount=2\baselineskip
\setbox\strutbox=\hbox{%
  \vrule height .7\baselineskip depth .3\baselineskip width 0pt}

\newcount\rowcount

\def\headersfor#1{
  \noalign{\global\rowcount=0 \medbreak}
  \bf #1& LVL& LDR& ATT& DEF& INI& SPD& HP& DMG\crcr
  \noalign{\nobreak\smallskip}}

\def\cr{\crcr\noalign{\maybeskip}}

\def\maybeskip{\ifnum\rowcount=2 \global\rowcount=0 \smallbreak
  \else \global\advance\rowcount by 1 \fi}

\halign{#\hfil\strut&& \quad\hfil#\crcr
  \headersfor{Orc}
  Goblin&         2& 35&  16& 10& 4& 2& 20&  2--4\cr
  Furious Goblin& 2& 40&  14& 14& 6& 3& 38&  3--8\cr
  Orc&            3& 60&  16& 17& 4& 2& 65&  7--10\cr
  Catapult&       3& 120& 33& 15& 4& 2& 80&  5--9\cr
  Veteran Orc&    4& 140& 25& 25& 6& 3& 110& 15--20\cr
  Shaman&         4& 200& 24& 32& 5& 3& 160& 15--18\cr
  \headersfor{Neutral}
  Thorn-Hunter&   1& 8&    4&  1& 2& 3& 5&   1--2\cr
  Thorn-Warrior&  1& 8&    4&  3& 4& 3& 8&   1--3\cr
  Fire Dragonfly& 1& 9&    3&  1& 5& 3& 6&   1--3\cr
  Lake Dragonfly& 1& 9&    3&  1& 6& 4& 6&   1--3\cr
  Devilfish&      1& 12&   6&  4& 6& 3& 10&  1--3\cr
  Venomous Spider&1& 12&   5&  1& 4& 3& 10&  2--3\cr
  Cave Spider&    1& 14&   4&  4& 2& 3& 14&  2--4\cr
  Hyena&          2& 20&   8&  8& 4& 3& 14&  3--4\cr
  Pirate&         2& 25&   8&  4& 4& 3& 20&  3--5\cr
  Swamp Snake&    2& 28&  12&  8& 4& 2& 25&  3--5\cr
  Fire Spider&    2& 30&  12& 12& 6& 3& 27&  4--5\cr
  Snake&          2& 30&  14&  8& 5& 2& 28&  3--6\cr
  % ...
}
\bye

enter image description here

[1] http://en.wikipedia.org/wiki/Robert_Bringhurst
[2] http://en.wikipedia.org/wiki/Edward_Tufte
[3] http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0001IV

(11) Looks quite nice and +1 for references to Bringhurst and Tufte. However, I am not sure if I like using grouping instead of 'zebra-striping', as it might read as if those rows grouped together have something in common... and at least for me, it does not separate each row enough. - Simon Lehmann
Thanks @Simon. I think I remember either Bringhurst or Tufte giving that grouping tip, but I couldn't find a reference to that. - morbusg
(2) Kind of nice, but I am not sure I visually appreciate it over the zebra-striping. My biggest concern – and this is a general issue I have with most "good rules" – is space efficiency. Bringhurst, Tufte and so on apparently address book writers with no page limit, which is only one very specific class of documents. For many other classes the data/space ratio is of higher relevance than the data/ink ratio – vertical lines (I found then ugly as well) are often used to achieve some legibility with very narrow columns. - Daniel
5
[+42] [2013-05-04 17:40:19] Tom Bombadil

There's always the ''obvious'' solution: use TikZ! (Note that I wasn't going for beauty, but for possibility)

Code

\documentclass[parskip]{scrartcl}
\usepackage[margin=15mm]{geometry}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{matrix}

\begin{document}

\pgfdeclarelayer{background}
\pgfsetlayers{background,main}

\begin{tikzpicture}
    \matrix (magic) [matrix of nodes,nodes={minimum width=3cm,minimum height=1cm,draw,very thin},draw,inner sep=0]
    {   |[fill=red!70]|8 & 1 & 6 \\
        3 & |[left color=cyan,right color=orange]| 5 & 7 \\
        4 & 9 & |[text=red,blue]|2 \\
    };
    \draw[thick,violet] (magic-2-1.east) to[out=180,in=270,looseness=0.5] (magic-2-1.north) to[out=270,in=0,looseness=0.5] (magic-2-1.west) to[out=0,in=90,looseness=0.5] (magic-2-1.south) to[out=90,in=180,looseness=0.5] (magic-2-1.east);
    \draw[rounded corners=2pt,densely dashed,green!50!gray] ($(magic-1-2.center)+(-0.15,-0.25)$) rectangle ($(magic-1-3.center)+(0.15,0.25)$);

\end{tikzpicture}

\end{document}

Output

enter image description here

Wasn't there a CW checkbox somewhere? I can't seem to find it.


TikZ tables are particularly useful when you need to include images in the table cells. Here a short example (needs several PNG images to compile):

\documentclass[9pt]{article}
\usepackage{tikz}
\newcommand{\orb}[2][0.15]{
  \node[minimum width=13mm] {
    \includegraphics[scale=#1]{orb-#2.png}
  };
}
\begin{document}
\begin{tikzpicture}
  \matrix[row sep=1mm, column sep=2mm] (orbs) {
  \node {0}; &            &                 & \orb[0.09]{s} \\
  \node {1}; &            & \orb{py}        & \orb[0.12]{pz}  & \orb{px} \\
  \node {2}; & \orb{dxy}  & \orb[0.14]{dyz} & \orb{dz2}       & \orb{dxz} & \orb{dx2-y2} \\
             & \node{-2}; & \node{-1};      & \node{0};       & \node{1}; & \node{2}; \\
  };
  \node[anchor=south, rotate=90, xshift=5mm] at (orbs.west) {angular momentum $\ell$};
  \node[anchor=north] at (orbs.south) {magnetic quantum number $m$};
\end{tikzpicture}
\end{document}

enter image description here


I would like to add another short example of a TikZ table. As it is a common wiki, should I just append it to your post or should I post it separately? - alexurba
@alexurba: It's CW, so you're very welcome to add! - Tom Bombadil
(37) TikZ is becoming like Excel: no matter what the task to be accomplished is, someone will try using it. :) - Federico Poloni
(3) @FedericoPoloni or like jQuery. :P - Jeel Shah
6
[+33] [2013-05-05 00:51:46] Gonzalo Medina

I really like the showcase of tables contained in Axel Reichert's tabsatz [1]; a tutorial on typesetting tables. The document is in German, but fortunately for those of us who don't read German, the code is understandable for everyone. The .tex document is also available for everyone to see the actual code used.

I will simply copy here two of the examples in the document using mainly just array, booktabs and dcolumn:

\documentclass[a4,portrait,semrot]{seminar}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[skip=4pt]{caption}
\usepackage{booktabs}
\usepackage{dcolumn}
\usepackage{units}
\usepackage{array}

\pagestyle{empty}
\renewcommand{\printlandscape}{\special{landscape}}
\slideframe{none}
\centerslidesfalse
\slidesmag{3}
\setlength{\slideheight}{183mm}
\setlength{\slidewidth}{264mm}

\makeatletter
\newcommand{\armultirow}[3]{%
  \multicolumn{#1}{#2}{%
    \begin{picture}(0,0)%
      \put(0,0){%
        \begin{tabular}[t]{@{}#2@{}}%
          #3%
        \end{tabular}%
      }%
    \end{picture}%
  }%
}%

\newcolumntype{f}{>{$}l<{$}}
\newcolumntype{n}{l}
\newcolumntype{N}{>{\scriptsize}l}
\newcolumntype{v}[1]{>{\raggedright\hspace{0pt}}p{#1}}
\newcolumntype{V}[1]{>{\scriptsize\raggedright\hspace{0pt}}p{#1}}
%
% array.sty, dcolumn.sty
\newcolumntype{B}[1]{>{\boldmath\DC@{.}{,}{#1}}l<{\DC@end}}
\newcolumntype{d}[1]{>{\DC@{.}{,}{#1}}l<{\DC@end}}
\newcolumntype{i}[1]{>{\DC@{.}{,}{#1}\mathnormal\bgroup}l<{\egroup\DC@end}}
\newcolumntype{s}[1]{>{\DC@{.}{,}{#1}\mathsf\bgroup}l<{\egroup\DC@end}}
%
% array.sty, rotating.sty
\newcolumntype{R}[1]{%
  >{\begin{turn}{90}\begin{minipage}{#1}\scriptsize\raggedright\hspace{0pt}}l%
  <{\end{minipage}\end{turn}}%
}
%
% array.sty, tabularx.sty
\newcolumntype{x}{>{\scriptsize\raggedright\hspace{0pt}}X}
\makeatother
\begin{document}

\begin{slide*}
  \begin{table}
    \centering
    \caption{Minuskelziffern}
    \label{tab:minuskelziffern}
    \begin{tabular}{@{}v{7em}i{4.0}i{3.0}i{5.0}n@{}}
      \toprule
        &
        \multicolumn{4}{N@{}}{Diese also Sachen} \\
      \cmidrule(l){2-5}
        &
        \multicolumn{1}{V{5.5em}}{Blick linken sonst endlich} &
        \multicolumn{1}{V{5.5em}}{auf nicht weit Soll des} &
        \multicolumn{1}{V{5em}}{gleich man kann ist} &
        \multicolumn{1}{V{5em}@{}}{weil Sache zu einem} \\
        &
        &
        \multicolumn{1}{N}{\unit{\%}} \\
      \cmidrule(r){1-1}\cmidrule(lr){2-2}\cmidrule(lr){3-3}\cmidrule(lr){4-4}%
        \cmidrule(l){5-5}
        \armultirow{1}{@{}v{7em}}{Um hier sonst damit Platz ist gegeben} &
          1991 & 20 & 45637 & \oldstylenums{657} unter  \\
        & 1992 & 47 & 47916 & \oldstylenums{645} linken \\
        & 1993 & 65 & 22848 & \oldstylenums{347} nein   \\
      \addlinespace
        \armultirow{1}{@{}v{7em}}{Durch gehört wollen und} &
          1994 &  87 & 46475 & \oldstylenums{957} einem  \\
        & 1995 &  95 & 94356 & \oldstylenums{8363} Sache \\
        & 1996 & 100 & 84646 & \oldstylenums{93635} nein \\
      \cmidrule(r){1-1}\cmidrule(lr){2-2}\cmidrule(lr){3-3}\cmidrule(lr){4-4}%
        \cmidrule(l){5-5}
        &
        \multicolumn{4}{N@{}}{Gerade langt hinauf sonst nicht gleich
          man} \\
      \cmidrule(r){1-1}\cmidrule(l){2-5}
        \armultirow{1}{@{}v{7em}}{Um hier damit Platz hat} &
          1796 &   4 & 46032 & \oldstylenums{56} scheidet \\
        & 1896 &  25 & 38937 & \oldstylenums{746} linken  \\
        & 1996 & 100 & 83458 & \oldstylenums{48746} eine  \\
      \bottomrule
    \end{tabular}
  \end{table}
\end{slide*}

\begin{slide*}
  \begin{table}
    \centering
    \footnotesize
    \caption{Kathodenfallableiter}
    \label{tab:kathoden}
    \begin{tabular}{@{}nd{1.1}*{3}{d{1.2}}d{1.1}d{3.2}@{}}
      \toprule
        \multicolumn{1}{@{}N}{Typenbezeichnung} &
        \multicolumn{5}{N}{Spannungsschutz für Netze} &
        \multicolumn{1}{N@{}}{Preis} \\
        &
        \multicolumn{5}{N}{Leiterspannung an der Einbaustelle} \\
      \cmidrule(lr){2-6}
        &
        \multicolumn{2}{V{6.5em}}{Nicht geerdeter Sternpunkt} &
        \multicolumn{2}{V{6.5em}}{Starr geerdeter Sternpunkt} &
        \multicolumn{1}{V{4em}}{Nenn"-spannung} \\
      \cmidrule(lr){2-3}\cmidrule(lr){4-5}
        &
        \multicolumn{1}{V{4.5em}}{Normale Leiterspannung} &
        \multicolumn{1}{V{4.5em}}{Zulässiger Bereich} &
        \multicolumn{1}{V{4.5em}}{Normale Leiterspannung} &
        \multicolumn{1}{V{4.5em}}{Zulässiger Bereich} \\
        &
        \multicolumn{1}{N}{\unit{kV}} &
        \multicolumn{1}{N}{\unit{kV}} &
        \multicolumn{1}{N}{\unit{kV}} &
        \multicolumn{1}{N}{\unit{kV}} &
        \multicolumn{1}{N}{\unit{kV}} &
        \multicolumn{1}{N}{DM} \\
      \cmidrule(r){1-1}\cmidrule(lr){2-2}\cmidrule(lr){3-3}\cmidrule(lr){4-4}%
        \cmidrule(lr){5-5}\cmidrule(lr){6-6}\cmidrule(l){7-7}
        H 484--1   & 1   & 1.15 & 1.25 & 1.45 & 1   & 220.$---$ \\
        H 484--1,5 & 1.5 & 1.8  & 1.9  & 2.2  & 1.5 & 233.$---$ \\
        H 484--2   & 2   & 2.3  & 2.5  & 2.9  & 2   & 252.$---$ \\
        H 484--2,5 & 3   & 2.9  & 3.1  & 3.6  & 2.5 & 261.$---$ \\
        H 484--3   & 3.5 & 3.5  & 3.8  & 4.3  & 3   & 264.$---$ \\
      \bottomrule
    \end{tabular}
  \end{table}
\end{slide*}

\end{document}

enter image description here

enter image description here

[1] http://www.ctan.org/pkg/tabsatz

(17) As one of those who read german: what is table 1? Some kind of Dada poem? - Tom Bombadil
@TomBombadil Maybe a variation on Lorem Ipsum - Felix Dombek
@TomBombadil I am not one of those who read German. No idea what table 1 is about; it looks nice, though. - Gonzalo Medina
(6) I usually do read German (it is my mother tongue at least ;) ), but I can't make any sense of it -- Dada poem seems to capture it quite nicely ;). I have to agree that it looks nice, though. - rainer
About the second table, Kathodenfallableiter. It's... interesting. I like it as well, except for the left alignments. Be honest, do you find it functional? I mean the numbers made it work, thus it would break with any other numbers unless you change the unit dimensions in the column headings. On second thought, I kind of believe it's not that much of a good example. It "just" looks nice at first. - henry
I am sorry, but I don´t like either tutorial nor tables. The tutorial is just a endless list of options and commands without proper explanation or advice, and the tables in my opinion are confusing. There are a lot better ways to present that data. For start: Never ever use headings that long! - Paul Paulsen
7
[+29] [2016-03-09 11:00:08] HarveyShepp

Unfortunately, as of 2018-11-12, the tabu package is still unmaintained [1] ( see repository [2]) and color are not working anymore. Therefore my example below is not working.

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

Flat Table Example

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

\definecolor{tableHeader}{RGB}{211, 47, 47}
\definecolor{tableLineOne}{RGB}{245, 245, 245}
\definecolor{tableLineTwo}{RGB}{224, 224, 224}

\newcommand{\tableHeaderStyle}{
    \rowfont{\leavevmode\color{white}\bfseries}
    \rowcolor{tableHeader}
}


\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}
        \tableHeaderStyle
        & Mot & Définition & \\
        ...
    \end{tabu}
\end{document}

You can find the whole code here [4] and access the rest of my LaTeX codes on my Github repository [5].

[1] https://tex.stackexchange.com/questions/121841/is-the-tabu-package-obsolete
[2] https://github.com/tabu-issues-for-future-maintainer/tabu
[3] http://ctan.org/pkg/tabu
[4] https://github.com/HarveySheppard/yLaTeX/tree/master/examples/yFlatTable
[5] https://github.com/HarveySheppard/yLaTeX

! Undefined control sequence. <recently read> \definecolor Something is missing as an import. - Zelphir Kaltstahl
(2) Sorry, I forgot the \usepackage{xcolor} line... I corrected it! - HarveyShepp
I think document class is missing? (But I still get an error) (nice table by the way!) - Arne Timperman
(2) 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. - HarveyShepp
ERROR: undefined control sequence: \end{tabu} with pdflatex - Xenonite
can you link to the code please? rather than the root of the repo - baxx
also - this example does not compile, copying the code you've given and pasting it into overleaf or something doesn't produce a result. - baxx
@baxx Because tabu is not maintained anymore, the example above indeed does not work. I modified my answer to reflect this. - HarveyShepp
My new LaTeX3 package tabularray is an alternative to the outdated tabu package. - L.J.R.
This example works on overleaf with xelatex and selecting texlive version 2017 (legacy) - innisfree
8
[+28] [2013-09-27 22:18:15] quinmars

I spend today much time to layout a table and I am pleased with the result. As some other answers I also use mainly the booktabs package and added some color. The main point is that I use pgfplotstable for typeset the table. Wich makes it very easy to reuse the defined style or to change the style later without touching the actual table. The table itself is that by this lines:

\pgfplotstabletypeset[normal,
    columns/eg/.style={
        column name={$E_{\textup{g}}$ (\si{\electronvolt})},
        dec sep align
    }
]{ %
    Material        & Symbol &  eg  & Type \\
    \topmidheader{5}{Elements}
    diamond         & C      & 5.46 & i \\
    ...
    \midheader{5}{IV-IV Compounds}
    silicon carbide & SiC 3C & 2.36 & i \\
    ...
    aluminium nitride & AlN  & 6.2  & d \\
}

Most of the styling is done by the style normal I defined before. The first line gives the header and the commands \topmidheader and \midheader define subheadings. The first argument (here 5) is the column count, note, that pgfplotstable adds an extra column for each numerical column. The column style eg is there for two reasons (1) it is not possible to have math and other complex stuff inside of a header cell and (2) we define that the numbers are align to the decimal point.

And here comes the full code:

\documentclass{article}

\usepackage{unicode-math}
\setmainfont[Mapping=tex-text, Numbers=OldStyle]{TeX Gyre Pagella}
\setmathfont[math-style=ISO]{TeX Gyre Pagella Math}

\usepackage{siunitx}
\usepackage{xcolor}
\usepackage{booktabs,colortbl, array}
\usepackage{pgfplotstable}
\pgfplotsset{compat=1.8}

\definecolor{rulecolor}{RGB}{0,71,171}
\definecolor{tableheadcolor}{gray}{0.92}
% Following is taken from Werner: http://tex.stackexchange.com/a/33761/3061
% and modified for my needs
%
% Command \topline consists of a (slightly modified)
% \toprule followed by a \heavyrule rule of colour tableheadcolor
% (hence, 2 separate rules)
\newcommand{\topline}{ %
        \arrayrulecolor{rulecolor}\specialrule{0.1em}{\abovetopsep}{0pt}%
        \arrayrulecolor{tableheadcolor}\specialrule{\belowrulesep}{0pt}{0pt}%
        \arrayrulecolor{rulecolor}}
% Command \midline consists of 3 rules (top colour tableheadcolor, middle colour black, bottom colour white)
\newcommand{\midtopline}{ %
        \arrayrulecolor{tableheadcolor}\specialrule{\aboverulesep}{0pt}{0pt}%
        \arrayrulecolor{rulecolor}\specialrule{\lightrulewidth}{0pt}{0pt}%
        \arrayrulecolor{white}\specialrule{\belowrulesep}{0pt}{0pt}%
        \arrayrulecolor{rulecolor}}
% Command \bottomline consists of 2 rules (top colour
\newcommand{\bottomline}{ %
        \arrayrulecolor{white}\specialrule{\aboverulesep}{0pt}{0pt}%
        \arrayrulecolor{rulecolor} %
        \specialrule{\heavyrulewidth}{0pt}{\belowbottomsep}}%


\newcommand{\midheader}[2]{%
        \midrule\topmidheader{#1}{#2}}
\newcommand\topmidheader[2]{\multicolumn{#1}{c}{\textsc{#2}}\\%
                \addlinespace[0.5ex]}

\pgfplotstableset{normal/.style ={%
        header=true,
        string type,
        font=\addfontfeature{Numbers={Monospaced}}\small,
        column type=l,
        every odd row/.style={
            before row=
        },
        every head row/.style={
            before row={\topline\rowcolor{tableheadcolor}},
            after row={\midtopline}
        },
        every last row/.style={
            after row=\bottomline
        },
        col sep=&,
        row sep=\\
    }
}

\begin{document}
    \begin{table}
        \centering
        \caption{The bandgab of some semiconductors.}
        \pgfplotstabletypeset[normal,
                columns/eg/.style={
                column name={$E_{\textup{g}}$ (\si{\electronvolt})},
                dec sep align
        }
        ]{ %
        Material        & Symbol &  eg  & Type \\
        \topmidheader{5}{Elements}
        diamond         & C      & 5.46 & i \\
        silicon         & Si     & 1.12 & i \\
        germanium       & Ge     & 0.67 & i \\
        selenium        & Se     & 1.74 & d \\
        \midheader{5}{IV-IV Compounds}
        silicon carbide & SiC 3C & 2.36 & i \\
        silicon carbide & SiC 4H & 3.28 & i \\
        silicon carbide & SiC 6H & 3.03 & i \\
        \midheader{5}{III-V Compounds}
        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}

enter image description here

The values are token from wikipedia [1].

[1] http://de.wikipedia.org/wiki/Bandl%C3%BCcke

(3) I think it should read bandgap in the caption. - Christian Lindig
I tried this and got a bunch of errors saying that I need to switch to lualatex for this to work. - Steven Sagona
I haven't used latex since awhile, but if remember correctly only the font related lines are lualatex specific,i.e., the unicode-math package and the setxxxfont commands. If you remove those lines it should work. - quinmars
9
[+28] [2017-06-08 12:40:09] AK16

My humble contribution from studying the way the Economist formats its tables.

Table 1

Table 2

\documentclass[10.8pt,a4]{article}
\usepackage[margin=1.1in,a4paper]{geometry}
\usepackage{booktabs}
\usepackage{caption}
\usepackage{float}
\usepackage{titlesec}
\usepackage{capt-of}

%dashed line
\usepackage{array}
\usepackage{arydshln}
\setlength\dashlinedash{0.2pt}
\setlength\dashlinegap{1.5pt}
\setlength\arrayrulewidth{0.3pt}

%Widows & Orphans & Penalties

\widowpenalty500
\clubpenalty500
\clubpenalty=9996
\exhyphenpenalty=50 %for line-breaking at an explicit hyphen
\brokenpenalty=4991
\predisplaypenalty=10000
\postdisplaypenalty=1549
\displaywidowpenalty=1602
\floatingpenalty = 20000


\usepackage[T1]{fontenc}
\usepackage{fontspec}
\setmainfont[Scale=0.85, Ligatures={Required,Common,Contextual,TeX}]{TeX Gyre Schola} % Incredible font inside latex


\begin{document}
\begin{table*}[] \centering
%\ra{1.3}
\begin{small}
\begin{tabular}{@{}lrrrrrrrrrrrr@{}}\toprule
\textbf{Debt/Assets} & \textbf{2002} & \textbf{2003} & \textbf{2004} & \textbf{2005} & \textbf{2006} & \textbf{2007} & \textbf{2008} & \textbf{2009} & \textbf{2010} & \textbf{2011} & \textbf{2012} & \textbf{Total} \\ \midrule
\textbf{<50\%} & -\% & 10\% & 5\% & 7\% & 11\% & 2\% & -\% & -\% & -\% & -\% & 3\% & 2\%\\ \hdashline
\textbf{<50\% - 59.9\%} & 20\ & 5\ & 16\ & 7\ & 11\ & 8\ & 13\ & 11\ & 9\ & 15\ & 8\ & 11\ \\ \hdashline
\textbf{<60\% - 69.9\%} &  -\ & 10\ & 5\ & 13\ & 11\ & 10\ & 16\ & 16\ & 17\ & 11\ & 15\ & 13\ \\ \hdashline
\textbf{<70\% - 79.9\%} &  -\ & 10\ & 37\ & 13\ & 15\ & 8\ & 24\ & 29\ & 16\ & 14\ & 35\ & 22\ \\ \hdashline
\textbf{<80\% - 89.9\%} &  40\ & 10\ & 5\ & 17\ & 7\ & 24\ & 18\ & 18\ & 21\ & 6\ & 8\ & 15\ \\ \hdashline
\textbf{>90\%} &  40\ & 55\ & 32\ & 43\ & 46\ & 49\ & 29\ & 26\ & 38\ & 24\ & 35\ & 37\ \\ \midrule
\textbf{Total} &  100\% & 100\% & 100\% & 100\% & 100\% & 100\% & 100\% & 100\% & 100\% & 100\% & 100\% & 100\% \\ \midrule
\textbf{Mean} &  85\% & 80\% & 77\% & 80\% & 78\% & 85\% & 79\% & 79\% & 82\% & 77\% & 80\% & 80\% \\ \hdashline
\textbf{Median} &  85\% & 94\% & 76\% & 81\% & 80\% & 87\% & 79\% & 77\% & 82\% & 75\% & 72\% & 80\% \\ \hdashline
\textbf{No. of Projects} &  5\% & 20\% & 19\% & 30\% & 46\% & 51\% & 68\% & 38\% & 58\% & 54\% & 26\% & 415\% \\
\bottomrule
\end{tabular}
\end{small}
\caption{Initial capital structures of large projects (\$1bn.+) \emph{(Finnerty, 2013)}}
\end{table*}

\begin{table*}[] \centering
%\ra{1.3}
\begin{small}
\begin{tabular}{@{}lrrrrrrrrrr@{}}\toprule
 & \textbf{1995} & \textbf{1996} & \textbf{1997} & \textbf{1998} & \textbf{1999} & \textbf{2000} & \textbf{2001} & \textbf{2002} & \textbf{Total}\\ \midrule
\textbf{Bank Loans} & \$23.33 & \$42.83 & \$67.43 & \$56.65 & \$72.39 & \$110.89 & \$108.48 & \$62.20 & \$557.88\\ \hdashline
\textbf{Bonds} & 3.79 & 4.79 & 7.70 & 9.79 & 19.79 & 20.81 & 25.00 & 13.80 & 109.26\\ \hdashline
\textbf{Development Agencies} & 17.59 & 18.96 & 22.05 & 20.97 & 16.62 & 17.69 & 18.75 & 18.75 & 162.63\\ \hdashline
\textbf{Total Debt} & 44.71 & 66.58 & 96.98 & 87.41 & 108.80 & 149.39 & 152.23 & 94.75 & 829.77\\ \hdashline
\textbf{Equity} & 19.16 & 28.54 & 41.56 & 37.46 & 46.70 & 64.02 & 65.24 & 40.61 & 355.68\\ \midrule
\textbf{Total} & \$63.88 & \$95.12 & \$138.54 & \$124.87 & \$155.68 & \$213.40 & \$217.47 & \$135.36 & \$1185.63\\ \midrule
\textbf{Bank Loans} & 37\% & 45\% & 49\% & 45\% & 46\% & 52\% & 50\% & 46\% & 42\% \\ \hdashline
\textbf{Bonds} & 6 & 5 & 5 & 8 & 13 & 10 & 11 & 10 & 9\\ \hdashline
\textbf{Development Agencies} & 28 & 20 & 16 & 17 & 11 & 8 & 9 & 14 & 14\\ \hdashline
\textbf{Total Debt} & 70 & 70 & 70 & 70 & 70 & 70 & 70 & 70 & 70\\ \hdashline
\textbf{Equity} & 30 & 30 & 30 & 30 & 30 & 30 & 30 & 30 & 30\\ \midrule
\textbf{Total} & 100  & 100  & 100  & 100  & 100  & 100  & 100  & 100  & 100\\
\bottomrule
\end{tabular}
\end{small}
\caption{Project funding by source (US\$ billions) \emph{(Finnerty, 2013)}}
\end{table*}

\begin{table*}[] \centering
%\ra{1.3}
\begin{small}
\begin{tabular}{@{}lllrrr@{}}\toprule
\textbf{Rank} & \textbf{Lead Arranger} & \textbf{Number of Deals} & \textbf{Dollar Amount} & \textbf{Market Share} & \textbf{Equator Principles Adoption}\\ \midrule
\textbf{1} & State Bank of India & 52 & \$21,631.6 & 10.1\% & NA\\ \hdashline
\textbf{2} & Mitsubishi UFJ Financial & 88 & 9,486.1 & 4.4 & Dec 2005\\ \hdashline
\textbf{3} & Sumitomo Mitsui & 71 & 8,188.1 & 3.8 & Jan 2006\\ \hdashline
\textbf{4} & Credit Agrocole & 60 & 6,506.4 & 3.1 & Jun 2005\\ \hdashline
\textbf{5} & Mizuho Financial & 55 & 5,797.5 & 2.7 & Oct 2003\\ \hdashline
\textbf{6} & Soci\'{e}t\'{e} Generale & 55 & 5,760.5 & 2.7 & Sep 2007\\ \hdashline
\textbf{7} & BNP Paribas & 55 & 5,390.8 & 2.5 & Oct 2008\\ \hdashline
\textbf{8} & Axis Bank & 18 & 5,216.9 & 2.4 & NA\\ \hdashline
\textbf{9} & IDBI Bank & 10 & 5,162.3 & 2.4 & NA\\ \hdashline
\textbf{10} & ING & 49 & 4,916.1 & 2.3 & Jun 2003\\ \midrule
 & Others & 102 & 135,430.4 & 63.6 & \\ \midrule
 & Total Market & 615 & \$213,486.7 & 100\% & \\
\bottomrule
\end{tabular}
\end{small}
\caption{Global project bank facility lead arrangers \emph{(Finnerty, 2013)}}
\end{table*}


\end{document}

Use siunitx to correctly format numbers and units, for example \SI{99}{\percent} will correctly produce 99 % - with a space before the % and there should also be spaces after > etc. (economists are bad at typesetting numbers correctly) - skvery
10
[+25] [2018-06-16 03:26:09] David Purton

I recently did this timetable in tikz. I found it easy to set things out in columns rather than rows. The original inspiration for this method was taken from http://www.texample.net/tikz/examples/timetable/

I'm happy with both the ease and flexibility in laying it out and the final look.

enter image description here

\documentclass{article}

\usepackage[landscape,a4paper]{geometry}
\usepackage{microtype}
\usepackage[default,semibold,light]{sourcesanspro}
\usepackage{realscripts}
\usepackage{parskip}
\pagestyle{empty}

\newcommand*{\roomone}{Adare Uniting Church Auditorium}
\newcommand*{\roomtwo}{Adare Uniting Church Hall}
\newcommand*{\roomfour}{Adare Uniting Church Foyer}
\newcommand*{\roomsix}{Adare Dining Room}
\newcommand*{\roomtwelve}{Bethany Hall}
\newcommand*{\roomfood}{\roomsix\slash\roomtwelve}
\newcommand*{\roommdgs}{Room listed on booklet cover}
\newcommand*{\roomseminars}{Rooms listed on p.~\pageref{seminars}}
\newcommand*{\roomworkshops}{Rooms listed on p.~\pageref{workshops}}

\newcommand*{\firstspeaker}{Gary Millar}
\newcommand*{\secondspeaker}{Reuben Salagaras}

\newcommand*{\timetablefont}{\scriptsize}

\newcommand*{\yscale}{0.862}

\newlength{\timewidth}
\settowidth{\timewidth}{\timetablefont\bfseries
  \addfontfeature{RawFeature=-pnum}00:00}
\addtolength{\timewidth}{4pt}

\newlength{\activitywidth}
\setlength{\activitywidth}{\textwidth}
\addtolength{\activitywidth}{-4\timewidth}
\addtolength{\activitywidth}{-14pt}
\setlength{\activitywidth}{0.25\activitywidth}

\usepackage[cmyk]{xcolor}
\definecolor{mdg}{cmyk}{0,0.3,0.24,0.03}
\definecolor{talk}{cmyk}{0.13,0,0,0}
\definecolor{coach}{cmyk}{0,0.02,0.22,0}
\definecolor{food}{cmyk}{0,0.2,0.41,0.06}
\definecolor{seminar}{cmyk}{0.08,0,0.11,0.04}
\definecolor{workshop}{cmyk}{0,0,0,0.11}

\usepackage{tikz}
\usetikzlibrary{positioning,chains}

\begin{document}

\begin{tikzpicture}[
    remember picture,
    overlay,
    node distance=0 cm,
    chain default direction=going below,
    inner sep=0pt,
    outer sep=1pt,
    font=\timetablefont,
    time/.style args={#1,#2}{
      anchor=north west,
      minimum width=\timewidth,
      minimum height=\yscale*#1cm-2pt,
      node contents={},
      append after command={
        node[anchor=north east, inner sep=0pt, outer sep=3pt,
        font=\timetablefont\bfseries\addfontfeature{RawFeature=-pnum}]
        at (\tikzlastnode.north east) {#2}
      },
      on chain
    },
    activity/.style args={#1,#2,#3}{
      anchor=north west,
      minimum width=\activitywidth,
      minimum height=\yscale*#1cm-2pt,
      node contents={},
      append after command={
        node[anchor=north west, inner sep=0pt, outer sep=3pt,
        text width=\activitywidth-6pt]
        at (\tikzlastnode.north west) {\textbf{#2}\\#3}
      },
      on chain
    }
  ]
  \begin{scope}[start chain]
    \node (fri-time) [time={1,}];
    \node[time={10,}];
    \node[time={2,18:00}];
    \node[time={1.5,20:00}];
    \node[time={1,21:30}];
  \end{scope}
  \begin{scope}[start chain]
    \node (fri) [right=of fri-time.north east, activity={1,\Large\hfill
    Friday\hfill\strut,}];
    \node[activity={10,,}];
    \node[activity={2,Registration,\roomfour}];
    \node[activity={1.5,Talk 1: \firstspeaker,\roomone},fill=talk];
    \node[activity={1,Supper,\roomtwo}];
  \end{scope}
  \begin{scope}[start chain]
    \node (sat-time) [right=of fri.north east, time={1,}];
    \node[time={1,8:00}];
    \node[time={1.5,9:00}];
    \node[time={0.75,10:30}];
    \node[time={1.25,11:15}];
    \node[time={0.5,12:45}];
    \node[time={1.5,13:00}];
    \node[time={1.5,14:30}];
    \node[time={0.5,16:00}];
    \node[time={1.5,16:30}];
    \node[time={1.5,18:00}];
    \node[time={1.5,19:30}];
    \node[time={1.5,21:00}];
  \end{scope}
  \begin{scope}[start chain]
    \node (sat) [right=of sat-time.north east, activity={1,\Large\hfill
    Saturday\hfill\strut,}];
    \node[activity={1,Breakfast,\roomfood}, fill=food];
    \node[activity={1.5,Talk 2: \secondspeaker,\roomone}, fill=talk];
    \node[activity={0.75,Morning tea,}];
    \node[activity={1.25,Ministry Discussion Group 1,Room listed on booklet
    cover}, fill=mdg];
    \node[activity={0.5,Coach's briefing,}];
    \node[activity={1.5,Lunch,\roomfood}, fill=food];
    \node[activity={1.5,Free time\slash Coaching slot 1,}, fill=coach];
    \node[activity={0.5,Afternoon tea,}];
    \node[activity={1.5,Free time\slash Coaching slot 2,}, fill=coach];
    \node[activity={1.5,Dinner,\roomfood}, fill=food];
    \node[activity={1.5,Talk 3: \firstspeaker,\roomone}, fill=talk];
    \node[activity={1.5,Supper,\roomtwo}];
  \end{scope}
  \begin{scope}[start chain]
    \node (sun-time) [right=of sat.north east, time={1,}];
    \node[time={0.5,}];
    \node[time={1,8:30}];
    \node[time={1.25,9:30}];
    \node[time={0.5,10:45}];
    \node[time={1.25,11:15}];
    \node[time={1,12:30}];
    \node[time={1,13:30}];
    \node[time={1.5,14:30}];
    \node[time={0.5,16:00}];
    \node[time={1.5,16:30}];
    \node[time={1.5,18:00}];
    \node[time={2,19:30}];
    \node[time={1,21:30}];
  \end{scope}
  \begin{scope}[start chain]
    \node (sun) [right=of sun-time.north east, activity={1,\Large\hfill
    Sunday\hfill\strut,}];
    \node[activity={0.5,,}];
    \node[activity={1,Breakfast,\roomfood}, fill=food];
    \node[activity={1.25,Seminars,\roomseminars}, fill=seminar];
    \node[activity={0.5,Morning tea,}];
    \node[activity={1.25,Workshops,\roomworkshops}, fill=workshop];
    \node[activity={1,Lunch,\roomfood}, fill=food];
    \node[activity={1,Ministry Discussion Group 2,\roommdgs}, fill=mdg];
    \node[activity={1.5,Free time\slash Coaching slot 3,}, fill=coach];
    \node[activity={0.5,Afternoon tea,}];
    \node[activity={1.5,Free time\slash Coaching slot 4,}, fill=coach];
    \node[activity={1.5,Dinner,\roomfood}, fill=food];
    \node[activity={2,Talk 4: \secondspeaker,\roomone}, fill=talk];
    \node[activity={1,Supper,\roomtwo}];
  \end{scope}
  \begin{scope}[start chain]
    \node (mon-time) [right=of sun.north east, time={1,}];
    \node[time={0.5,}];
    \node[time={0.5,8:30}];
    \node[time={1,9:00}];
    \node[time={0.5,10:00}];
    \node[time={1,10:30}];
    \node[time={1.5,11:30}];
    \node[time={1,13:00}];
  \end{scope}
  \begin{scope}[start chain]
    \node[right=of mon-time.north east, activity={1,\Large\hfill
    Monday\hfill\strut,}];
    \node[activity={0.5,,}];
    \node[activity={0.5,Light breakfast,}];
    \node[activity={1,Ministry Discussion Group 3,\roommdgs}, fill=mdg];
    \node[activity={0.5,Personal reflection\slash prayer,}];
    \node[activity={1,Brunch,\roomtwo}, fill=food];
    \node[activity={1.5,Talk 5: \firstspeaker,\roomone}, fill=talk];
    \node[activity={1,Pack up and leave,}];
  \end{scope}
\end{tikzpicture}%

\end{document}

Nice result. However the code seems to be a bit complicated. If the height and position of the activity "cells" would be calculated automatically from the time span, it would be much easier to insert activities. - student
11
[+22] [2013-05-04 11:49:48] user13907

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

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  
    33       &  \alert{100001}   &  \alert{41}   &  \alert{21} \\
\midrule
\alert{117}  & 1110101           & \alert{165}   & \alert{75} \\
\midrule
\alert{451}  & \alert{111000011} &   703         & \alert{1C3} \\
\midrule
\alert{431}  & \alert{110101111} & \alert{657}   &   1AF \\
\bottomrule
\end{tabular}

\end{center}

}

\end{document}

Result:

enter image description here

[1] http://en.wikibooks.org/wiki/LaTeX/Tables

(31) Er... Most of the examples there look really awful :-( - Stephan Lehmke
(16) For me it looks like a gallery of what is possible - NOT a gallery of what is beautiful. - hpekristiansen
(6) No vertical lines + booktabs is the way to go :) - jub0bs
12
[+19] [2021-08-22 03:28:05] L.J.R.

I will give an example about drawing a chessboard with the new LaTeX3 package tabularray [1]:

\documentclass{article}

\usepackage{fontspec} % Need XeLaTeX or LuaLaTeX
\setmainfont{Arial Unicode MS}
%\setmainfont{Segoe UI Symbol}

\usepackage{xcolor}
\usepackage{tabularray}

\begin{document}

\begin{center}
\begin{tblr}{
  rows = {35pt}, columns = {35pt},
  rowsep = 1pt, colsep = 1pt, stretch = 0,
  cells = {c,font=\Huge},
  cell{odd}{even} = {azure7},
  cell{even}{odd} = {azure7},
  hlines, vlines,
}
♜ & ♞ & ♝ & ♛ & ♚ & ♝ & ♞ & ♜ \\
♟ & ♟ & ♟ & ♟ & ♟ & ♟ & ♟ & ♟ \\
   &   &   &   &   &   &   &   \\
   &   &   &   &   &   &   &   \\
   &   &   &   &   &   &   &   \\                            
   &   &   &   &   &   &   &   \\                            
♙ & ♙ & ♙ & ♙ & ♙ & ♙ & ♙ & ♙ \\
♖ & ♘ & ♗ & ♕ & ♔ & ♗ & ♘ & ♖ \\
\end{tblr}
\end{center}

\begin{center}
\begin{tblr}{colspec={lXXXXXX},hlines}
Chess & King & Queen & Rook & Bishop & Knight & Pawn \\
White & ♔   & ♕    & ♖   & ♗      & ♘     & ♙   \\
Black & ♚   & ♛    & ♜   & ♝      & ♞     & ♟   \\
\end{tblr}
\end{center}

\end{document}

enter image description here

[1] https://ctan.org/pkg/tabularray

13
[+4] [2021-01-24 22:38:14] koppor

The package tablestyles [1] was designed to offer convenient typesetting of good-looking tables.

sansbold style

Preamble:

\usepackage{tabularx}
\usepackage[table]{xcolor}
\usepackage{colortbl}
\usepackage{tablestyles}

Content:

\begin{table}
%
\tablestyle[sansbold]
%
\begin{tabular}{*{2}{p{0.45\textwidth}}}
\theadstart
    \thead header &
    \thead header \\
\tbody
 %
 content  & content \\
 content  & content \\
 content  & content \\
 %
 \tsubheadstart
 \tsubhead subhead &
 \tsubhead subhead \\
 %
 content  & content \\
 content  & content \\
 \tend
\end{tabular}
\caption{sansbold style}
\label{tab:style:sansbold}
\end{table} 
[1] https://ctan.org/pkg/tablestyles

14
[+3] [2021-09-12 00:02:38] ad_bek

I made my example using that of @Jeel Shah with simple enhancement(font and color) i'm planing to use it in my book

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

\setlist{nolistsep}

\definecolor{blue}{HTML}{008ED7}
\definecolor{mygray}{gray}{0.75}
\definecolor{lightBlue}{HTML}{e5f7ff}

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

\begin{document}

\begin{center}
\fontfamily{cmss}\selectfont
\begin{tabularx}{\textwidth}[t]{XX}
\arrayrulecolor{blue}\hline
\rowcolor{lightBlue} \textbf{\textcolor{blue}{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{mygray}\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
\item[1.6] Proportion of employed people living below \$1 (PP) a day
\item[1.7] Proportion of own-account and contribution family workers in total employment
\end{itemize} 
\end{minipage}\\

\hline

Target 1.C Halve, between 1990 and 2015, the proportion of people who suffer from hunger &
\begin{minipage}[t]{\linewidth}%
\begin{itemize}
\item[1.8] Prevalence of underweight children under five years of age
\item[1.9] Proportion of population below minimum level of dietary energy consumption
\end{itemize}
\end{minipage}\\

\arrayrulecolor{blue}\hline
\rowcolor{lightBlue} \textbf{\textcolor{blue}{Goal 2 Achieve universal primary education}} & \\
\hline

Target 2.A Ensure that by 2015 children everywhere, boy and girls alike, will be able to complete a full course of primary schooling. &
\begin{minipage}[t]{\linewidth}%
\begin{itemize}
\item[2.1] Net enrollment ratio in primary education
\item[2.2] Proportion of pupils starting grade 1 who reach last grade of primary education
\item[2.3] Literacy rate of 15- to 24-year-olds, women and men
\end{itemize}
\end{minipage}\\

\hline
\rowcolor{lightBlue} \multicolumn{2}{l}{%
\textbf{\textcolor{blue}{Goal 3 Promote gender equality and empower women}}} \\
\hline

Target 3.A Eliminate gender disparity in primary and secondary education, preferably by 2005, and in all levels of education no later than 2015 &
\begin{minipage}[t]{\linewidth}%
\begin{itemize}
\item[3.1] Ratios of girls to boys in primary, secondary and tertiary education
\item[3.2] Share of women in wage employment in the non-agricultural sector.
\end{itemize} 
\end{minipage}
\end{tabularx}
\end{center}

\end{document}

enter image description here


@Jeel Shah this one is based on your template, thanks for sharing. - ad_bek
15