[Tex/LaTex] Table with merged cells

tables

I would like to have a table to looks like this:

enter image description here

\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}

Best Answer

Like this:

enter image description here

\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.