Formatting tables - guidelines

This commit is contained in:
Krishna Kumar 2014-06-29 20:06:31 +01:00
parent 142f34fc6b
commit 111106fbcc
5 changed files with 96 additions and 25 deletions

View File

@ -38,12 +38,16 @@ doesn't it? well we can add some text to it \dots
and here I write more \dots
\section{The layout of formal tables}
This section has been modified from ``Publication quality tables in \LaTeX*''
by Simon Fear.
You will not go far wrong if you remember two simple
guidelines at all times:
The layout of a table has been established over centuries of experience and
should only be altered in extraordinary circumstances.
When formatting a table, remember two simple guidelines at all times:
\begin{enumerate}
\item Never, ever use vertical rules.
\item Never, ever use vertical rules (lines).
\item Never use double rules.
\end{enumerate}
@ -53,9 +57,6 @@ example, if you feel that the information in the left half of
a table is so different from that on the right that it needs
to be separated by a vertical line, then you should use two
tables instead. Not everyone follows the second guideline:
I have worked for a publisher who insisted on a
double light rule above a row of totals. But this would not
have been my choice.
There are three further guidelines worth mentioning here as they
are generally not known outside the circle of professional
@ -71,23 +72,81 @@ typesetters and subeditors:
will serve just as well. If it won't, then repeat the value.
\end{enumerate}
Whether or not you wish to follow the minor niceties,
if you use only the following commands in your formal tables
your reader will be grateful. I stress that
the guidelines are not just to
keep the pedantic happy. The principal is that enforced structure of
presentation
enforces structured thought in the first instance.
A frequently seen mistake is to use `\textbackslash begin\{center\}' \dots `\textbackslash end\{center\}' inside a figure or table environment. This center environment can cause additional vertical space. If you want to avoid that just use `\textbackslash centering'
Now we can refer to the table using Table.~\ref{t:borders}.
\begin{table}
\caption{Table with borders}
\caption{A badly formatted table}
\centering
\label{t:borders}
\begin{tabular}{l c r}
\toprule
1 & 2 & 3 \\ \midrule
4 & 5 & 6 \\ \midrule
7 & 8 & 9 \\ \bottomrule
\label{table:bad_table}
\begin{tabular}{|l|c|c|c|c|}
\hline
& \multicolumn{2}{c}{Species I} & \multicolumn{2}{c|}{Species II} \\
\hline
Dental measurement & mean & SD & mean & SD \\ \hline
\hline
I1MD & 6.23 & 0.91 & 5.2 & 0.7 \\
\hline
I1LL & 7.48 & 0.56 & 8.7 & 0.71 \\
\hline
I2MD & 3.99 & 0.63 & 4.22 & 0.54 \\
\hline
I2LL & 6.81 & 0.02 & 6.66 & 0.01 \\
\hline
CMD & 13.47 & 0.09 & 10.55 & 0.05 \\
\hline
CBL & 11.88 & 0.05 & 13.11 & 0.04\\
\hline
\end{tabular}
\end{table}
\begin{table}
\caption{A nice looking table}
\centering
\label{table:nice_table}
\begin{tabular}{l c c c c}
\hline
\multirow{2}{*}{Dental measurement} & \multicolumn{2}{c}{Species I} & \multicolumn{2}{c}{Species II} \\
\cline{2-5}
& mean & SD & mean & SD \\
\hline
I1MD & 6.23 & 0.91 & 5.2 & 0.7 \\
I1LL & 7.48 & 0.56 & 8.7 & 0.71 \\
I2MD & 3.99 & 0.63 & 4.22 & 0.54 \\
I2LL & 6.81 & 0.02 & 6.66 & 0.01 \\
CMD & 13.47 & 0.09 & 10.55 & 0.05 \\
CBL & 11.88 & 0.05 & 13.11 & 0.04\\
\hline
\end{tabular}
\end{table}
\begin{table}
\caption{Even better looking table using booktabs}
\centering
\label{table:good_table}
\begin{tabular}{l c c c c}
\toprule
\multirow{2}{*}{Dental measurement} & \multicolumn{2}{c}{Species I} & \multicolumn{2}{c}{Species II} \\
\cmidrule{2-5}
& mean & SD & mean & SD \\
\midrule
I1MD & 6.23 & 0.91 & 5.2 & 0.7 \\
I1LL & 7.48 & 0.56 & 8.7 & 0.71 \\
I2MD & 3.99 & 0.63 & 4.22 & 0.54 \\
I2LL & 6.81 & 0.02 & 6.66 & 0.01 \\
CMD & 13.47 & 0.09 & 10.55 & 0.05 \\
CBL & 11.88 & 0.05 & 13.11 & 0.04\\
\bottomrule
\end{tabular}
\end{table}

View File

@ -4,7 +4,7 @@
%% %%
%% A PhD thesis LaTeX template for Cambridge University Engineering Department%%
%% %%
%% Version: v1.0 %%
%% Version: v1.4 %%
%% Authors: Krishna Kumar %%
%% Date: 2013/11/16 (inception) %%
%% License: MIT License (c) 2013 Krishna Kumar %%

View File

@ -55,11 +55,12 @@
%\usepackage{sty/caption/subcaption}
\usepackage{subcaption}
% ********************************** Table *************************************
% ********************************** Tables ************************************
\usepackage{booktabs} % For professional looking tables
%\usepackage{longtable}
\usepackage{multirow}
%\usepackage{multicol}
%\usepackage{multirow}
%\usepackage{longtable}
%\usepackage{tabularx}

View File

@ -1,6 +1,17 @@
% ------------------------------------------------------------------------
% SAMPLE BIBLIOGRAPHY FILE
% ------------------------------------------------------------------------
@misc{cve-2008-1368,
key = {CVE-2008-1368},
title = {Publication quality tables in \LaTeX*},
howpublished = {},
institution = {NIST},
day = 17,
month = {March},
year = 2008,
note = {[online] \url{http://nvd.nist.gov/nvd.cfm?cvename=CVE-2008-1368}},
url = {http://nvd.nist.gov/nvd.cfm?cvename=CVE-2008-1368}
}
@MISC{prime-number-theorem,
author = "Charles Louis Xavier Joseph de la Vall{\'e}e Poussin",

Binary file not shown.