# Vertical Spacing for Table with Equations [duplicate]

So I have a table with equations, below. It's a bit crunched up and I want to add vertical space in the rows. I'm using booktabs package for heavy lifting.

\begin{table}
\begin{tabular}{lcc}
\toprule
Name & Function & Derivative & \\
\midrule
Sigmoid & $\phi(x) = \ddfrac{1}{1+e^{-x}}$ &  $\phi'(x) = \phi(x)(1-\phi(x))$\\
TanH    & $\phi(x) = \ddfrac{2}{1+e^{-2x}} - 1$ & $\phi'(x) = 1-\phi(x)^2$ \\
ReLU    & $\phi(x) = \begin{cases} 0 & x \leq 0 \\ x & x > 0 \end{cases}$
& $\phi'(x) = \begin{cases} 0 & x \leq 0 \\ 1 & x > 0 \end{cases}$ \\
Leaky ReLU & $\phi(x) = \begin{cases} \alpha x & x \leq 0 \\ x & x > 0 \end{cases}$
& $\phi'(x) = \begin{cases} \alpha & x \leq 0 \\ 1 & x > 0 \end{cases}$ \\
\bottomrule
\end{tabular}
\caption{Activation functions and their derivatives.}
\label{tab:activation-functions}
\end{table}


Here's the produced output. I tried adding: \renewcommand{\arraystretch}{2} before I write the table but it messes up more. Here's the result. So any idea how to make it look pretty with the equations? Looking for a relatively quick solution because this is the only table I'll have with equations. But open to anything that works.

• The answers to this question contain a broad variety of possibilities on how to increase the height of table rows. – leandriis Apr 5 '18 at 19:25
• IMHO, the table will look much better without the vertical lines and left-aligning the formula columns. Additional space between rows can be specified with booktabs' \addlinespace. – Heiko Oberdiek Apr 7 '18 at 15:01

You can use after \\ as \\[3ex] as your desire spacing by changing the value of the numeral.

 \documentclass[a4paper]{article}
\usepackage{booktabs}
\usepackage{amsmath}

\begin{document}
\begin{table}
\begin{tabular}{l|cc|cc|}
\toprule
Name & Function & Derivative & \\
\midrule
Sigmoid & $\phi(x) = \dfrac{1}{1+e^{-x}}$ &  $\phi'(x) = \phi(x)(1-\phi(x))$\\[3ex]
TanH    & $\phi(x) = \dfrac{2}{1+e^{-2x}} - 1$ & $\phi'(x) = 1-\phi(x)^2$ \\[3ex]
ReLU    & $\phi(x) = \begin{cases} 0 & x \leq 0 \\ x & x > 0 \end{cases}$
& $\phi'(x) = \begin{cases} 0 & x \leq 0 \\ 1 & x > 0 \end{cases}$ \\[4ex]
Leaky ReLU & $\phi(x) = \begin{cases} \alpha x & x \leq 0 \\ x & x > 0 \end{cases}$
& $\phi'(x) = \begin{cases} \alpha & x \leq 0 \\ 1 & x > 0 \end{cases}$ \\
\bottomrule
\end{tabular}
\caption{Activation functions and their derivatives.}
\label{tab:activation-functions}
\end{table}
\end{document} 