# Table with merged cells

I would like to have a table to looks like this: \documentclass{article}
\usepackage[english]{babel}

\begin{document}
\begin{center}
\begin{tabular}{ | p{5cm} | l | l | p{5cm} |}
\hline
& Taylor expansion &  & Power series \\ \hline
& $$f(x)=\sum_{k=0}^{n}a_k(x-1)^{k}+o((x-a)^{n})$$ &  & $$f(x)=\sum_{n\geq 0} a_k(x-1)^{k}$$     \\ \hline
Order  & $DL_{n}(0)$  &  $DL_{5}(0)$  &  \\ \hline
exp(x) & $$\sum_{k=0}^{n}\dfrac{x^k}{k!}+o(x^n)$$  & $$1+x+\drac{x^2}{2}+$$  & $$\sum_{k=0}^{n}\dfrac{x^k}{k!}$$ \\ \hline

\end{tabular}
\end{center}

\end{document}


## 2 Answers

Like this: \documentclass{article}
\usepackage[english]{babel}
\usepackage{makecell}
\setcellgapes{5pt}
\usepackage{mathtools}

\begin{document}
\begin{center}
\makegapedcells
\begin{tabular}{ | l | *{4}{>{$\displaystyle}c<{$}|}}
\hline
&   \multicolumn{2}{c|}{Taylor expansion}    & Power series \\ \hline
&   \multicolumn{2}{c|}{$\displaystyle f(x)=\sum_{k=0}^{n}a_k(x-1)^{k}+o((x-a)^{n})$}
&   f(x)=\sum_{n\geq 0} a_k(x-1)^{k}    \\
\hline
Order   &   DL_{n}(0)   &   DL_{5}(0)           &                                       \\
\hline
$\exp(x)$   &   \sum_{k=0}^{n}\frac{x^k}{k!}+o(x^n)
&   1+x+\frac{x^2}{2}+  & \sum_{k=0}^{n}\frac{x^k}{k!}         \\
\hline
\end{tabular}
\end{center}
\end{document}


Note: Use of $$...$$ is in LaTeX deprecate. Instead it you should use $...$ or \begin{equation*} ... \end{equation*}. Since all this math environments don't work in column types c, l and r, instead them I use $\displaystyle ...$. For shorter code I modified columns type to >{$\displaystyle}c<{$} so the whoole column is in math mode (except \multicolumns). Therefore the text in header of the last column had to be in wrote as \text{Power series}.

More vertical space around cells content is obtained by macros \setcellgapes{5pt} and \makegapedcells from package makecell.

Would this work?

\documentclass{article}
\begin{document}
\begin{tabular}{|c|c|c|c|}
\hline
& \multicolumn{2}{c|}{Taylor expansion} & Power series \\ \hline
& \multicolumn{2}{c|}{ $f(x)=\sum_{k=0}^{n}a_k(x-1)^{k}+o((x-a)^{n})$} & $f(x)=\sum_{n\geq 0} a_k(x-1)^{k}$ \\ \hline
Order & $DL_{n}(0)$ & $DL_{5}(0)$ & \\ \hline
\end{tabular}
\end{document} • Well, not really. ;-) When cells are merged, the excess goes on the last merged column. – egreg Dec 21 '16 at 16:19
• @egreg I am not sure I understand what you mean by "excess". Do you refer to columns DLn and DL5 to be of unequal size? – cheesecake Dec 21 '16 at 22:29