2

How to make vertically centered the text in a multirow in the tabular environment? If I type

\documentclass[11pt]{amsart}
\usepackage{multirow}

  \begin{document}

  \begin{tabular}{ | p{1cm} |  p{2cm} | p{3cm} |}
  \hline 
  Brand & Model & Description \\
  \hline 
  \multirow{2}{*}{Honda} & CRV & super nice car with four wheels \\
  \cline{2-3}
  & CRW & Car that doesn't even exist \\
  \hline
  \end{tabular}

  \end{document}

I get the result below. As you can see, the "Honda" name is not well placed vertically : it is not in the middle of the double row. I think I understand what's happening here: the second and third line of my table had been enlarged vertically to fit the long descriptions in the third columns; but it look likes the command \multirow ignored this fact and still acts as if these rows had their normal size.

What to do to put "Honda" in the center of its box ?

enter image description here

  • I keep my solution, I don't have a better one at the moment. Using makecell could perhaps improve the situation. – user31729 Jun 7 '15 at 16:57
1

A solution consists in entering the \multirow command in the last row, with a negative argument. I added some vertical padding to the rows, with the cellspace package (hence I had to add a small correction for positioning the contents of the multirow cell):

\documentclass[11pt]{amsart}

\usepackage{multirow}
\usepackage{cellspace}
\setlength\cellspacetoplimit{3pt}
\setlength\cellspacebottomlimit{3pt}

\begin{document}

\begin{tabular}{ | p{1.2cm}| p{2cm} | S{p{3cm}}|}
  \hline
  Brand & Model & Description \\
  \hline
                               & CRV & super nice car with four wheels \\
  \cline{2-3}
  \multirow{-2}{*}[2pt]{Honda} & CRW & Car that doesn't even exist \\
  \hline
\end{tabular}

\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.