How to add extra spaces between rows in tabular environment?
You have at least three options here:
Increasing the array stretch factor using
\renewcommand{\arraystretch}{<factor>}
where<factor>
is a numeric value:\documentclass{article} \begin{document} \renewcommand{\arraystretch}{2} \begin{tabular}{c c} $f^{(n)}(x)$ & $f^{(n)}(0)$ \\\hline $-2xe^{-x^{x^{x^2}}}$ & 0 \end{tabular} \end{document}
Explicitly specifying the row skip using
\\[<len>]
where<len>
is any length:\documentclass{article} \begin{document} \begin{tabular}{c c} $f^{(n)}(x)$ & $f^{(n)}(0)$ \\[1cm] \hline $-2xe^{-x^{x^{x^2}}}$ & 0 \end{tabular} \end{document}
Modifying the
array
package's\extrarowheight
length using\setlength{\extrarowheight}{<len>}
, where<len>
is any length:\documentclass{article} \usepackage{array}% http://ctan.org/pkg/array \begin{document} \setlength{\extrarowheight}{20pt} \begin{tabular}{c c} $f^{(n)}(x)$ & $f^{(n)}(0)$ \\\hline $-2xe^{-x^{x^{x^2}}}$ & 0 \end{tabular} \end{document}
In the above examples, the \hline
was used to illustrate the effect of the different styles used. The choice depends on the specific usage/typesetting of the tabular
within your document.
Finally, if the contents of your entire tabular
is math, you could typeset it in an array
environment:
\[
\begin{array}{c c}
f^{(n)}(x) & f^{(n)}(0) \\
-2xe^{-x^{x^{x^2}}} & 0
\end{array}
\]
You can use booktabs
. Left is the output using \midrule
, right the one with the \hline
approach.
The left table is also improved by stating \displaystyle
that uses less cramped superscripts.
\documentclass{article}
\usepackage{array,booktabs}
\newcolumntype{C}{>{$\displaystyle}c<{$}}
\begin{document}
\begin{tabular}{CC}
f^{(n)}(x) & f^{(n)}(0) \\
\midrule
-2xe^{-x^{x^{x^2}}} & 0
\end{tabular}
\qquad
\begin{tabular}{cc}
$f^{(n)}(x)$ & $f^{(n)}(0)$ \\
\hline
$-2xe^{-x^{x^{x^2}}}$ & 0
\end{tabular}
\end{document}
You have another option here - specifying row colors:
\documentclass{article}
\usepackage{color, colortbl}
%Light gray:
\definecolor{Gray}{gray}{0.9}
%Light cyan:
\definecolor{LightCyan}{rgb}{0.88,1,1}
\begin{document}
\renewcommand{\arraystretch}{2}
\begin{tabular}{c c}
\rowcolor{Gray}
$f^{(n)}(x)$ & $f^{(n)}(0)$ \\\hline
\rowcolor{LightCyan}
$-2xe^{-x^{x^{x^2}}}$ & 0
\end{tabular}
\end{document}