I have long text in a multirow cell. And the text takes more rows than the rows in the second column.
\documentclass[a4paper,12pt]{report}
\usepackage{multirow}
\usepackage{longtable}
\begin{document}
\begin{longtable}[H]{|p{\dimexpr0.5\linewidth-2\tabcolsep}|p{\dimexpr0.5\linewidth-2\tabcolsep}|}
\caption{Title}
\tabularnewline\hline
\multirow{2}{\linewidth}{\centering \tiny \textbf{Long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long text}} & \tiny 11 \tabularnewline \cline{2-2}
& \tiny 11 \tabularnewline \cline{1-2}
\end{longtable}
\end{document}
I get this:
How can I fix it? I generate table automatically, and I do not know how many lines of text in the multirow cell takes. So I can not manually add blank lines in the second column.
Update for Bernard When I compile this code:
\documentclass[a4paper,12pt]{report}
\usepackage[utf8]{inputenc}
\usepackage{multirow}
\usepackage{longtable}
\usepackage{makecell}
\begin{document}
\begin{longtable}{|m{\dimexpr0.5\linewidth-2\tabcolsep\relax}|m{\dimexpr0.5\linewidth-2\tabcolsep\relax}|}
\caption{Title}
\tabularnewline\hline%
\multirow{2}{*}{\parbox{\linewidth}%[24pt]
{\centering \scriptsize \textbf{Long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long}}}
& \Gape[12pt]{\scriptsize 11} \tabularnewline
\cline{2-2}
& \Gape[12pt]{\scriptsize 11} \tabularnewline
\cline{1-2}
\end{longtable}\bigskip
{\normalsize
\begin{longtable}{|m{\dimexpr0.5\linewidth-2\tabcolsep\relax}|m{\dimexpr0.5\linewidth-2\tabcolsep\relax}|}
\caption{Title}
\tabularnewline\hline%
\multirowcell{8}{\parbox{\linewidth}
{\centering \textbf{Long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long}}}
&\multirowcell{4}{11} \tabularnewline & \tabularnewline & \tabularnewline & \tabularnewline
\cline{2-2}
& \multirowcell{4}{11} \tabularnewline & \tabularnewline & \tabularnewline & \tabularnewline
\cline{1-2}
\end{longtable}
}
\end{document}
I see this result:
longtable
is going to be set in\tiny
size (at least that's the way it looks in your MWE), it may be best to provide that directive before the start of thelongtable
environment; otherwise you'll get serious problems with baselines not lining up. Second, have you thought about inserting "struts" (invisible vertical bars) in the cells of the second column?