How to increase row height while using booktabs?
For single lines booktabs
provides \addlinespace
:
\documentclass{article}
\usepackage{booktabs}
\begin{document}
\begin{table}\centering
\begin{tabular}{lrc}
\toprule[2pt]
a & b & c \\
\cmidrule[1pt](rl){1-3}
d & e & f \\
j & k & l \\
\addlinespace[0.5em]
g & h & i \\
\bottomrule[2pt]
\end{tabular}\caption{abcde}
\end{table}
\end{document}
The easiest here would be to adjust the value of \arraystretch
. For example,
\renewcommand{\arraystretch}{2}
Here's a view on the difference:
\documentclass[12pt, letterpaper]{article}
%\usepackage{amsmath}
%\usepackage{nag}
\usepackage[margin=1.0in]{geometry}% http://ctan.org/pkg/geometry
\usepackage{booktabs}% http://ctan.org/pkg/booktabs
%\usepackage[tableposition=top]{caption}
\newcommand{\mytable}{%
\begin{tabular}{llll}
\toprule
A & B & C & D \\
\midrule
A: $\frac{6}{16}$ B: $\frac{5}{16}$ C: $\frac{3}{16}$ D: $\frac{2}{16}$ & 1.9375919592 & 1.88285606369 & 0.0547358955059 \\
A: $\frac{6}{16}$ B: $\frac{5}{16}$ C: $\frac{4}{16}$ D: $\frac{1}{16}$ & 1.94014431443 & 1.80503653258 & 0.135107781856 \\
A: $\frac{6}{16}$ B: $\frac{6}{16}$ C: $\frac{2}{16}$ D: $\frac{2}{16}$ & 1.87649654966 & 1.81127812446 & 0.0652184251977 \\
A: $\frac{6}{16}$ B: $\frac{6}{16}$ C: $\frac{3}{16}$ D: $\frac{1}{16}$ & 1.87992559246 & 1.76409765557 & 0.115827936888 \\
A: $\frac{7}{16}$ B: $\frac{3}{16}$ C: $\frac{3}{16}$ D: $\frac{3}{16}$ & 1.93245604561 & 1.88024081494 & 0.0522152306624 \\
A: $\frac{7}{16}$ B: $\frac{4}{16}$ C: $\frac{3}{16}$ D: $\frac{2}{16}$ & 1.86806360636 & 1.84960175271 & 0.0184618536479 \\
A: $\frac{7}{16}$ B: $\frac{4}{16}$ C: $\frac{4}{16}$ D: $\frac{1}{16}$ & 1.87194209421 & 1.7717822216 & 0.100159872612 \\
A: $\frac{7}{16}$ B: $\frac{5}{16}$ C: $\frac{2}{16}$ D: $\frac{2}{16}$ & 1.81500630063 & 1.79617969195 & 0.0188266086843 \\
A: $\frac{7}{16}$ B: $\frac{5}{16}$ C: $\frac{3}{16}$ D: $\frac{1}{16}$ & 1.81178637864 & 1.74899922306 & 0.0627871555774 \\
\bottomrule
\end{tabular}
}
\begin{document}
\begin{table}
\centering
\caption{Test}
\mytable
\end{table}
\begin{table}
\centering
\caption{Test}
\renewcommand{\arraystretch}{2}
\mytable
\end{table}
\end{document}
Note that this affects the entire table. For more (including individual modifications), see Column padding in tables.
This might seem complicated, but allows for fine tuning the output: since fractions are the culprits in this particular situation and changing \arraystretch
would affect all table rows, I propose to use a different command for the fractions, so as to insert a strut next to them; this strut is larger than the normal one and computed from the fractions themselves.
\documentclass[12pt, letterpaper]{article}
\usepackage[margin=1.0in]{geometry}
\usepackage{amsmath}
\usepackage{booktabs}
\usepackage[tableposition=top]{caption}
\newcommand{\fracpadding}{}
\newcommand{\setfracpadding}[1][2pt]{%
\sbox0{$\frac{1}{2}$}%
\dimen0=\ht0 \advance\dimen0 #1\relax
\dimen2=\dp0 \advance\dimen2 #1\relax
\edef\fracpadding{\vrule width 0pt height \the\dimen0 depth \the\dimen2\relax}%
}
\newcommand{\afrac}[2]{\fracpadding\frac{#1}{#2}}
\begin{document}
\begin{table}[htbp]
\centering
\setfracpadding
\caption{Test}
\begin{tabular}{llll}
\toprule
A & B & C & D \\
\midrule
A: $\afrac{6}{16}$ B: $\afrac{5}{16}$ C: $\afrac{3}{16}$ D: $\afrac{2}{16}$ & 1.9375919592 & 1.88285606369 & 0.0547358955059 \\
A: $\afrac{6}{16}$ B: $\afrac{5}{16}$ C: $\afrac{4}{16}$ D: $\afrac{1}{16}$ & 1.94014431443 & 1.80503653258 & 0.135107781856 \\
A: $\afrac{6}{16}$ B: $\afrac{6}{16}$ C: $\afrac{2}{16}$ D: $\afrac{2}{16}$ & 1.87649654966 & 1.81127812446 & 0.0652184251977 \\
A: $\afrac{6}{16}$ B: $\afrac{6}{16}$ C: $\afrac{3}{16}$ D: $\afrac{1}{16}$ & 1.87992559246 & 1.76409765557 & 0.115827936888 \\
A: $\afrac{7}{16}$ B: $\afrac{3}{16}$ C: $\afrac{3}{16}$ D: $\afrac{3}{16}$ & 1.93245604561 & 1.88024081494 & 0.0522152306624 \\
A: $\afrac{7}{16}$ B: $\afrac{4}{16}$ C: $\afrac{3}{16}$ D: $\afrac{2}{16}$ & 1.86806360636 & 1.84960175271 & 0.0184618536479 \\
A: $\afrac{7}{16}$ B: $\afrac{4}{16}$ C: $\afrac{4}{16}$ D: $\afrac{1}{16}$ & 1.87194209421 & 1.7717822216 & 0.100159872612 \\
A: $\afrac{7}{16}$ B: $\afrac{5}{16}$ C: $\afrac{2}{16}$ D: $\afrac{2}{16}$ & 1.81500630063 & 1.79617969195 & 0.0188266086843 \\
A: $\afrac{7}{16}$ B: $\afrac{5}{16}$ C: $\afrac{3}{16}$ D: $\afrac{1}{16}$ & 1.81178637864 & 1.74899922306 & 0.0627871555774 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}
The default padding is 2pt above and below the fraction; one can also say \setfracpadding[3pt]
or with another length. Instead of setting it globally, I suggest to set it where needed; so if you change your mind and decide to typeset a table with such fractions in smaller type, you can simply add the \small
or \footnotesize
declaration just before \setfracpadding
.