I am using package tabular
but encounter a problem with the spacing of rows, I would like to have more space at the top and at the bottom of each formula. I already looked at older posts dealing with this issue and they suggested to use arraystretch
but it stretches all the rows (I don't want first row to be stretched for example) but most importantly unequally (there is more space at the top than at the bottom).
This is what my table currently looks like:
This is what arraystretch
(with factor 3) do to it:
In both cases it is not aesthetically pleasing. And I can't seem to find any simple solution to my problem.
Here's my code:
\documentclass{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[french]{babel}
\usepackage{array}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\begin{document}
\begin{center}
\begin{tabular}{|c|c|c|}
\hline
Nom de la méthode & Formule de majoration de l'erreur & Ordre de convergence \\
\hline
Rectangles à gauche & $|E_h^{RG}(f)| \leq \dfrac{h}{2} (\beta-\alpha)\lVert f'\rVert_{\infty}^{[a,b]}$ & 1 \\
\hline
Point Milieu & $|E_h^{PM}(f)| \leq \dfrac{h^2}{24} (\beta-\alpha)\lVert f^{(2)}\rVert_{\infty}^{[a,b]}$ & 2 \\
\hline
Trapèzes & $|E_h^T(f)| \leq \dfrac{h^2}{12} (\beta-\alpha)\lVert f^{(2)}\rVert_{\infty}^{[a,b]}$ & 2 \\
\hline
Simpson & $|E_h^S(f)| \leq \dfrac{h^4}{2880} (\beta-\alpha)\lVert f^{(4)}\rVert_{\infty}^{[a,b]}$ & 4 \\
\hline
\end{tabular}
\end{center}
\end{document}
\usepackage{makecell} \setcellgapes{6pt}
to the preamble and\makegapedcells
beofr yourtabular
should help. You can of course adjust the amount to of added space to your needs.cellspace
that is covered in the currently-accepted answer.