1

I give you a little example, so it's more easy to explain:

\documentclass[a4paper,12pt]{book}
\usepackage{multirow}
\usepackage{longtable}
\begin{document}
\begin{longtable}{|c|c|}
\hline
\parbox[b][2cm][t]{3cm}{Text1} & \multirow{2}{*}{Text 3} \\
\cline{1-1}
Text 2 & \\
\hline
\end{longtable}
\end{document}

The height of two cells is different and when I try to center the merged cell LaTeX align the content to the line that separate the two cells. I know that I can fix this alignment with a fix offset in \multirow command, but I have to do it by "hand" a lot of time with different size of every cell. It's possible to align automatically the content to the real middle of merged cell and not to \hline?

Werner
  • 603,163

1 Answers1

2

Here, rather than using multirow, I embed a tabular within a tabular.

\documentclass[a4paper,12pt]{book}
\usepackage{multirow}
\usepackage{longtable}
\begin{document}
NEW:
\begin{longtable}{|@{}c@{}|c|}
\hline
\begin{tabular}{p{3cm}}
Text1 \rule[-48pt]{0pt}{0pt}\\
\hline
\centering Text 2  
\end{tabular}
& Text 3 \\
\hline
\end{longtable}
ORIGINAL:
\begin{longtable}{|c|c|}
\hline
\parbox[b][2cm][t]{3cm}{Text1} & \multirow{2}{*}{Text 3} \\
\cline{1-1}
Text 2 & \\
\hline
\end{longtable}
\end{document}

enter image description here