# Not vertical centering in multirow at \newline

MWE

\documentclass[a4paper,11pt]{article}
\usepackage{multirow}
\usepackage{array}
\begin{document}

\begin{tabular}{|m{3cm}|m{3cm}|}\hline
X & Y \\ \hline
\multirow{2}{*}{No problem} & One Line \\ \cline{2-1}
& Two Line \\ \hline
\multirow{2}{*}{Problem} & One Line \\ \cline{2-1}
& 1 \newline 2 \newline 3 \newline 4\\ \hline
\end{tabular}

\end{document}


displaying

.

About One Line,1,2,3,4 rows in Y column, It sees like two rows. How it sees five rows? That is, "Problem" in X column, will vertical centering.

[I am sorry, my English.]

• Replace \multirow{2} with \multirow{5}. – Bernard Apr 21 '15 at 10:32
• @Bernard, perfect working. – Özgür Apr 21 '15 at 10:38
• A basis to work with such situations: if you have multilined cells next to a multirow, count the number of of lines, not the number of rows, and adjust if necessary. – Bernard Apr 21 '15 at 11:15
• @Paul Gessler: Done (added some details about manual adjustments). – Bernard Apr 22 '15 at 11:35

You should replace \multirow{2} with \multirow{5}. Indeed \multirow seems to be done for one-lined cells, and in case of multilined cells, one should count the number of lines rather than the number of rows, and make some manual adjustment if necessary, to take into account the thickness of intermediate lines, extra vertical spacing between rows (\extrarowheight from the array package, \addlinespace, \aboverulesep, belowrulesep and the like from booktabs, &c.).