# Not enough space in table for fractions

The table that I'd like to make does not display fractions with enough space between lines. What's the reasoning for this? (Not enough rep to be able to post a picture yet unfortunately.)

\documentclass{article}
\usepackage{amsmath,amsfonts}
\usepackage{booktabs}

\begin{document}
\begin{table}
\centering
\begin{tabular}{lcccc}
\toprule
\textbf{Care type} & $\mathbb{P}(Pat \cap H)$ & $\mathbb{P}(Pat \cap H')$ & $\mathbb{P}(Pat' \cap H)$ & $\mathbb{P}(Pat' \cap H')$\\
\midrule
Direct care  &$\displaystyle \dfrac{58}{197}$  &  $\displaystyle \dfrac{48}{197}$  & $\displaystyle \dfrac{21}{197}$* &$1-\displaystyle \dfrac{58}{197}$ \\
Housekeeping &$\displaystyle \dfrac{12}{17}$  &  $\displaystyle \dfrac{2}{17}$  & $\displaystyle \dfrac{5}{17}$* &$1-\displaystyle \dfrac{12}{17}$\\
\bottomrule
\end{tabular}
\caption{Probabilities of hand hygiene given direct patient contact}
\label{tab:handwash_given_pat}
\end{table}
\end{document}


Edit: Image added and MWE completed.

-
write before the tabular environment \def\arraystretch{1.5} –  Herbert Aug 14 '12 at 8:49
This also changes the spacing in the head line. –  Heiko Oberdiek Aug 14 '12 at 8:52
Thanks! I tried \def\arraystretch{2}, which is just about acceptable. Is this the best workaround? –  HCAI Aug 14 '12 at 8:59
Two suggestions. (1) Why not write 58/197 and so on? (2) All fractions are integral multiples of 1/197, so you could write everything in multiples of 1/197l this would make it easier to compare the probabilities in the same columns. –  Marc van Dongen Oct 21 '14 at 13:23

Manually the spacing can be fixed by several methods:

• \renewcommand*{\arraystretch}{2} (see Herbert's comment)
However, this also affects the spacing of the other lines.

• Adding a vertical space in the optional argument of \\, e.g.:

\begin{tabular}{...}
...
...\\[2ex]
...\\[1.5ex]
\bottomrule
\end{tabular}

• Adding an invisible rule in the line, e.g.:

\begin{tabular}{...}
...
\rule{0pt}{3.5ex}Direct care ...\\
\rule[-2.5ex]{0pt}{7ex}Housekeeping ...\\
\bottomrule
\end{tabular}

-
Thank you Heiko, this is very useful! :) Somehow it seems that LaTex doesn't deal with deep table cells well. Why do you think this is? –  HCAI Aug 14 '12 at 9:12
In the tables array struts are automatically added, kind of invisible rules with .7\baselineskip height and .3\baselineskip depth. The total amount is changed by \arraystretch. Package array allows the addition of \extrarowheight. The strut stuff works with normal text, but the method is limited if large objects are used. –  Heiko Oberdiek Aug 14 '12 at 10:11
Thanks! The "invisible rule" trick is awesome. Exactly what I was looking for ;) –  citronas Apr 21 '13 at 10:49

Another option is to use the package units and then replace your \frac{a}{b} with \nicefrac{a}{b}. The numerator and denominator will be offset diagonally and they fit nicely into tables.

-
You should probably also mention that if one pursues this route, the numbers will be typeset in scriptstyle mode, with a font size that's reduced by 30 percent relative to textstyle mode used in the OP's code. –  Mico Oct 21 '14 at 13:13
Welcome to TeX.SX! –  Andrew Swann Oct 21 '14 at 13:23