When creating a table, Latex sometimes doesn't fit the row height well, making the content intersect with the borders as in the following:
Notice how the first row is too short while the second looks good.
This is generated by the code:
\begin{tabular} { | c | c | }
\hline
$\left(\frac{1}{2},\frac{1}{2}\right)$ & $(1,1)$ \\ \hline
$(1,1)$ & $\left(\frac{1}{1+c},\frac{1}{1+c}\right)$ \\ \hline
\end{tabular}
Any ideas as to how to make Latex allocate enough space for the rows without explicit commands?
Perhaps the problem is not with the table but rather the parenthesis, so a solution to that (make the parenthesis around the contents of the first cell larger) would help as well.
Best Answer
You have three main solutions:
cellspace
package, which defines aminimal
vertical spacing between the contents of a cell and the above or below cell (\cellspacetoplimit
and\cellspacebottomlimit
). You have to prefix the column specifier with the letterS
, orC
if you usesiunitx
.makecell
package and the pair of commands\setcellgapes{some length}
(in preamble) and\setcellgapes
(for specific tables)booktabs
package and itstoprule
,\(c)midrule
and\bottomrule
commands, which add some vertical (adjustable) spacing around them. No vertical rules in this case.Here is a demo with your specific code. See the details in the documentation of the packages: