I have made a table and in it, I have to use the multirow
package for the headers. Works fine when there are two lines but it y-overflows when there are three. I tried increasing the space in each row with \setlength\extrarowheight
but that just increased the cell and the overflow remained.
Here are a few pictures:
How do I solve this?
Here is the source for the table:
\documentclass[11pt,a4paper]{article}
\usepackage{multirow}
\begin{document}
\begin{table}[h!]
\centering
\caption{OVERFLOW}
\bgroup
\def\arraystretch{1.5}%
\begin{tabular}{|c|c|c|c|c|c|c|c|}
\hline
\multirow{2}{*}{
\begin{tabular}[c]{@{}c@{}}Extension\\
$x/\mathrm{cm}$\end{tabular}} &
\multicolumn{5}{c|}{
\begin{tabular}[c]{@{}c@{}}Distance travelled \\
$s_{i}/\mathrm{cm}$\end{tabular}} &
\multirow{2}{*}{
\begin{tabular}[c]{@{}c@{}}Avg. distance\\
$s/\mathrm{cm}$\end{tabular}} &
\multirow{2}{*}{
\begin{tabular}[c]{@{}c@{}}Uncertainty in\\
avg. distance\\ $\Delta s/\pm \mathrm{cm}$\end{tabular}} \\
\cline{2-6} &
Trial 1 & Trial 2 & Trial 3 & Trial 4 & Trial 5 & & \\
\hline
\end{tabular}
\egroup
\end{table}
\end{document}
Best Answer
Edit:
With using
makecell
package for define multi-line multi-row cell, I obtain:In table instead to increase
\arraystretch
I use gaped cells frommakecell
package: