# Is there such thing as “p{height}”

I am making a table right now and it's really annoying that items in my cell are getting crunched

\begin{center}
\begin{tabular}{|c| c | c|}
Critical Points $P_0$ & $f(P_0)$ & Conclusion \\
\hline
(0,0,1)     & 0 & Local Extrema\\ \hline
(0,0,-1)    & -2  & Absolute minimum \\ \hline
$\left ( 0,0,\frac{1}{2} \right )$ & $\frac{1}{4}$ & Local Extrema \\  \hline

$(0,0, \frac{\sqrt{12}}{5})$ & $\frac{8}{5}$ & Absolute maximum \\ \hline

$(0,0, -\frac{\sqrt{12}}{5})$ & $\frac{8}{5}$ & Absolute maximum \\
\end{tabular}
\end{center}


My fractions are getting crushed and there is no such thing as "p{height}" to fix.

-

Instead of increasing the vertical space for rows, I propose you some changes:

1. Don't use \frac{a}{b} but simply a/b; this increases readability.
2. Use the features provided by the booktabs and array packages.
3. Eliminate the vertical rules.

\documentclass{article}
\usepackage{amsmath}
\usepackage{array}
\usepackage{booktabs}

\begin{document}

\begin{center}
\begin{tabular}{*{2}{>{$}c<{$}} c}
\toprule
\multicolumn{1}{c}{Critical Points $P_0$} & f(P_0) & Conclusion \\
\cmidrule(r){1-1}\cmidrule(lr){2-2}\cmidrule(l){3-3}
(0,0,1)     & 0 & Local Extrema\\
(0,0,-1)    & -2  & Absolute minimum \\
(0,0,1/2 )  & 1/4 & Local Extrema \\
(0,0,\sqrt{12}/5) & 8/5 & Absolute maximum \\
(0,0, -\sqrt{12}/5) & 8/5 & Absolute maximum \\
\bottomrule
\end{tabular}
\end{center}

\end{document}


If, for some reason, using array and booktabs is not possible, my first and third recommendations still apply and you can change \arraystretch; something along these lines:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{center}
\renewcommand\arraystretch{1.2}
\begin{tabular}{c c c}
\hline
Critical Points $P_0$ & $f(P_0)$ & Conclusion \\
\hline
$(0,0,1)$     & $0$ & Local Extrema\\
$(0,0,-1)$   & $-2$  & Absolute minimum \\
$(0,0,1/2 )$  & $1/4$ & Local Extrema \\
$(0,0,\sqrt{12}/5)$ & $8/5$ & Absolute maximum \\
$(0,0, -\sqrt{12}/5)$ & $8/5$ & Absolute maximum \\
\hline
\end{tabular}
\end{center}

\end{document}


-
What fi I don't want new packages? My computer can can't so much stuff –  Hawk Jun 2 '12 at 22:50
@jak please see my updated answer. –  Gonzalo Medina Jun 2 '12 at 22:55
Now I am going to be even more annoying and ask is if there are anyway of using \frac{}{} in tables without it getting crushed? –  Hawk Jun 2 '12 at 22:56
@jak you could use \dfrac instead of \frac (requires amsmath), but I personally don't like the result: \begin{center} \renewcommand\arraystretch{1.4} \begin{tabular}{c c c} \hline Critical Points $P_0$ & $f(P_0)$ & Conclusion \\ \hline (0,0,1) & 0 & Local Extrema\\ (0,0,-1) & -2 & Absolute minimum \\ $\left( 0,0,\dfrac{1}{2} \right)$ & $\dfrac{1}{4}$ & Local Extrema \\ $\left( 0,0, \dfrac{\sqrt{12}}{5} \right)$ & $\dfrac{8}{5}$ & Absolute maximum \$\left( 0,0, -\dfrac{\sqrt{12}}{5} \right)$ & $\dfrac{8}{5}$ & Absolute maximum \\ \hline \end{tabular} \end{center}. –  Gonzalo Medina Jun 2 '12 at 23:03
I used \dfrac initally and same thing happened lol –  Hawk Jun 2 '12 at 23:11

The package cellspace offers a simple way to get the correct height:

\documentclass{article}
\usepackage{amsmath}
\usepackage{array}
\usepackage{booktabs}
\usepackage{cellspace}
\begin{document}

\begin{center}
\begin{tabular}{>{$}c<{$}>{$}Sc<{$}c}
\toprule
\multicolumn{1}{c}{Critical Points $P_0$} & f(P_0) & Conclusion \\
\cmidrule(r){1-1}\cmidrule(lr){2-2}\cmidrule(l){3-3}
(0,0,1)     & 0 & Local Extrema\\
(0,0,-1)    & -2  & Absolute minimum \\
(0,0,1/2 )  & \dfrac14 & Local Extrema \\
(0,0,\sqrt{12}/5) & \dfrac85 & Absolute maximum \\
(0,0, -\sqrt{12}/5) & \dfrac85 & Absolute maximum \\
\bottomrule
\end{tabular}
\end{center}

\end{document}


-
That is big.... –  Hawk Jun 2 '12 at 23:11