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 and here I write more \dots
\section{The layout of formal tables} \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 The layout of a table has been established over centuries of experience and
guidelines at all times: should only be altered in extraordinary circumstances.
When formatting a table, remember two simple guidelines at all times:
\begin{enumerate} \begin{enumerate}
\item Never, ever use vertical rules. \item Never, ever use vertical rules (lines).
\item Never use double rules. \item Never use double rules.
\end{enumerate} \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 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 to be separated by a vertical line, then you should use two
tables instead. Not everyone follows the second guideline: 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 There are three further guidelines worth mentioning here as they
are generally not known outside the circle of professional 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. will serve just as well. If it won't, then repeat the value.
\end{enumerate} \end{enumerate}
Whether or not you wish to follow the minor niceties, 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'
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.
Now we can refer to the table using Table.~\ref{t:borders}.
\begin{table} \begin{table}
\caption{Table with borders} \caption{A badly formatted table}
\centering \centering
\label{t:borders} \label{table:bad_table}
\begin{tabular}{l c r} \begin{tabular}{|l|c|c|c|c|}
\toprule \hline
1 & 2 & 3 \\ \midrule & \multicolumn{2}{c}{Species I} & \multicolumn{2}{c|}{Species II} \\
4 & 5 & 6 \\ \midrule \hline
7 & 8 & 9 \\ \bottomrule 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{tabular}
\end{table} \end{table}

View File

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

View File

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

View File

@ -1,6 +1,17 @@
% ------------------------------------------------------------------------ % ------------------------------------------------------------------------
% SAMPLE BIBLIOGRAPHY FILE % 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, @MISC{prime-number-theorem,
author = "Charles Louis Xavier Joseph de la Vall{\'e}e Poussin", author = "Charles Louis Xavier Joseph de la Vall{\'e}e Poussin",

Binary file not shown.