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?

migrated from stackoverflow.com Dec 18 '14 at 1:25

This question came from our site for professional and enthusiast programmers.

  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – cfr Dec 18 '14 at 1:35
1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.