# Vertically centered multirow with automatically wrapped multilined cells

I have the following code for a table.

\documentclass{article}
\usepackage{tabularx}
\usepackage{makecell, multirow}

\begin{document}
\begin{tabularx}{\textwidth}{*{2}{l} X}
\hline

& \emph{Specification}
& The proband begins in the anatomical 0-degree starting position. From there the arm
is moved sidewards, away from the body hence, lifting the arm inside the frontal
plane. This is done as far as possible or until the proband starts to feel pain.
\\

& \emph{Instructions}
& TODO
\\

\hline

& \emph{Specification}
& TODO
\\

& \emph{Instructions}
& TODO
\\

\hline
\end{tabularx}
\end{document}


As you can see in the following picture the contents of the first column only get vertically centered when the cells to the aren't automatically wrapped to multiline cells. I want them to get vertically centered in both situations.

I tried several things.

1. Using tabu-package doesn't change anything irrespective of the things i tried next.
2. Don't use makecell-package and use multirow{2}{*}{...} instead. No real effect.
3. Use multirowcell{2}{\textbf{...}} instead \multirowthead{2}. No effect.
4. Use \multirowthead and \multirowcell with \usepackage{makecell} only. No effect.
5. Use makecell for the long text in the last column. Puts the text in one line and removes any wrapping.
6. Do 5 but add \\ for manual wrapping. This actually works, but this is the least desireable method, since I have to find the right spots for the line breaks myself rather than letting LaTeX wrap the cells automatically for me.

Does anybody know a way to keep the automatic wrapping but still get beautifully vertically centered multirows?

I also would like the cells in the second column to align vertically centered. Any idea how I could achieve that?

• Change the first \multirowthead{2}{Abduction} as \multirowhead{7}{Abduction} and compile you will get what you want. – murugan May 8 '16 at 14:58
• @murugan Nope, that's not working and it would be guessing wich number to chose to get the right centering. This wouldn't center the text automatically and most likely the centering won't be exact. Furtehmore, this is not what the multirow environment is for. – Lilo May 8 '16 at 15:10
• The multirow environment uses the number of lines used in its argument, not the number of rows. In other words, it is made for one-lined cells. – Bernard May 8 '16 at 15:48
• @Bernard That is what I got know too. But how would I achieve the desired behaviour anyway? – Lilo May 8 '16 at 15:50

Here you are. I added some vertical padding to cells, with the \makegapedcells command from makecell:

\documentclass{article}
\usepackage{tabularx}
\usepackage{makecell, multirow}
\setcellgapes[t]{2pt}

\begin{document}

\makegapedcells
\begin{tabularx}{\textwidth}{*{2}{l} X}
\hline
& \emph{Specification}
& The proband begins in the anatomical 0-degree starting position. From there the arm
is moved sidewards, away from the body hence, lifting the arm inside the frontal
plane. This is done as far as possible or until the proband starts to feel pain.
\\
& \emph{Instructions}
& TODO
\\
\hline
& \emph{Specification}
& TODO
\\
& \emph{Instructions}
& TODO
\\
\hline
\end{tabularx}

\end{document}


• Which clearly shows that the terms in the first column should be at the top, rather than hanging from nowhere. Not your fault, of course. – egreg Jul 7 '16 at 23:28
• @egreg: ‘No levitation for first columns’ is a fine slogan :o) – Bernard Jul 7 '16 at 23:48