# vertical alignment for nested cells in multirow table

This is what I came up with so far:

I'm trying to achieve the right column to be vertically centered over the parent rows like the cell containing "Puffer" so that the previous columns aren't affected. I don't really want a fixed length here, because I just want basically a list of items.

Unfortunately it's always aligned at the top and seems to be rendered just inside the first of the multirow cells which crashes the whole design.

I've already tried it with stack and itemize, but I seem to miss something more basic here.

Hopefully someone can help me out here because I can't find a proper or understandable solution anywhere.

\documentclass[12pt,a4paper]{article}
\usepackage[a4paper,lmargin={2.5cm},rmargin={2.5cm},tmargin={3cm},bmargin={2.5cm}]{geometry}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman, english]{babel}

\usepackage{makecell}
\usepackage[table]{xcolor}
\usepackage{multirow}

\newcommand{\arr}{$\rightarrow$ }

\usepackage{array}
\usepackage{enumitem}
\usepackage{latexsym}
\usepackage{caption}

\begin{document}

\begin{table}[ht]
\centering
%\rowcolors{2}{gray!25}{white}
\begin{tabular}[c]{|c|c|c|}\cline{3-3}
\multicolumn{2}{c|}{\multirow{1}{*}{}}&\multicolumn{1}{c|}{Inhalt}\\\cline{3-3}
\hline
\multicolumn{1}{|c|}{
\multirow{4}{*}{12/2020}}&
1. Woche&
\multicolumn{1}{|c|}{\multirow{3}{*}{

\makecell{\arr Test \\ \arr Test}
}}\\\cline{2-2}&
2. Woche&
\multicolumn{1}{|c|}{}\\\cline{2-3}&
3. Woche&
\multicolumn{1}{|c|}{\multirow{2}{*}{\arr Puffer}}\\\cline{2-2}&
4. Woche&
\multicolumn{1}{|c|}{}\\
\hline
\end{tabular}
\end{table}

\end{document}


Update:

I've added @Bernard's simplified version and added more text to it to see if it still gets aligned correctly. The code:

\begin{table}\setlength{\extrarowheight}{2pt}
\begin{tabular}{|c|c|l|}\cline{3-3}
\multicolumn{2}{c|}{\multirow{1}{*}{}}&\multicolumn{1}{c|}{Inhalt}\\\cline{3-3}
\hline
\multirow{4}{*}{12/2020} &
1. Woche &
\multirowcell{2}{\arr Prepare samples \\[2pt] \arr Implement Feedback}
\\\cline{2-2}&
2. Woche &
\\ \cline{2-3}&
3. Woche & \multirow{2}{*}{\arr Puffer} \\\cline{2-2}&
4. Woche & \\
\hline
\end{tabular}
\end{table}


results in:

• Welcome to TeX.SX! Probably this answer might help you. And one hint for later on, please always add a full MWE. In yours e.g. \documentclass, \begin{documnet} and so on are missing. It really makes it easier to help you if we can simply copy and paste a running code to reproduce your problems. – Steradiant Jun 23 '20 at 11:25
• Will you add more items later? – leandriis Jun 23 '20 at 12:25
• @leandriis yes, I'm planning to add more items later. – Smittie Jun 23 '20 at 12:26
• Then the chosen approach with the multirow command in that column will not work properly. – leandriis Jun 23 '20 at 12:28
• @Steradiant okay, I've updated my post to make it copy-pasteable (: However I'm not really getting much out of your mentioned post. – Smittie Jun 23 '20 at 12:44

I propose this simpler code, with a left alignment of the right column (except for the column head):

\begin{table}\setlength{\extrarowheight}{2pt}
\begin{tabular}{|c|c|l|}\cline{3-3}
\multicolumn{2}{c|}{\multirow{1}{*}{}}&\multicolumn{1}{c|}{Inhalt}\\\cline{3-3}
\hline
\multirow{4}{*}{12/2020} & %}&
1. Woche &
\multirowcell{2}{\arr Test \\[2pt] \arr Test}
\\\cline{2-2}&
2. Woche&
\\ \cline{2-3}&
3. Woche & \multirow{2}{*}{\arr Puffer} \\\cline{2-2}&
4. Woche & \\
\hline
\end{tabular}
\end{table}


Edit: With longer items, the code works as expected:

\setlength{\extrarowheight}{2pt}
\begin{tabular}{|c|c|l|}\cline{3-3}
\multicolumn{2}{c|}{\multirow{1}{*}{}}&\multicolumn{1}{c|}{Inhalt}\\
\hline
\multirow{4}{*}{12/2020} &
1. Woche &
\multirowcell{2}[0pt][l]{\arr Prepare samples\\
\arr Implement Feedback
}
\\\cline{2-2}&
2. Woche&
\\ \cline{2-3}&
3. Woche & \multirow{2}{*}{\arr Puffer} \\\cline{2-2}&
4. Woche & \\
\hline
\end{tabular}


• This is indeed 98% of what I was looking for. How can I align the content of the "Inhalts"-column to the left no matter how long the text? I tried changing all relevant cols from {| c |} to {| l |} but the content remains horizontally centered. – Smittie Jun 23 '20 at 12:17
• There are seceral possibilitis. B.t.w., what are the various \multicolumn{1}{|c|} for? They result in thicker vertical lines. Is it on purpose? – Bernard Jun 23 '20 at 12:24
• I just grabbed them from another example here on the forum. So it's not on purpose but I missed this detail till now :D – Smittie Jun 23 '20 at 12:42
• @Smittie: I've added a variant, with a simpler code and some improvements. Please see if it corresponds to what you want. – Bernard Jun 23 '20 at 13:02
• Thank you, this looks simpler indeed. However if I produce more text it still remains centered. – Smittie Jun 23 '20 at 14:13

It seems that you want \arr Test\\ \arr Test to occupy three rows. If so, you need to let 1. Woche or 2. Woche to occupy two rows.

\documentclass{article}
\usepackage{multirow}
\usepackage{makecell}
\newcommand{\arr}{$\rightarrow$ }

\begin{document}
\begin{table}[ht]
\centering
\begin{tabular}{|c|c|c|}
\cline{3-3}
\multicolumn{2}{c|}{} & \multicolumn{1}{c|}{Inhalt}\\
\hline
\multirow{5}{*}{12/2020} & \multirow{2}{*}{1. Woche}
& \multirowcell{3}{\arr Test\\ \arr Test} \\
& &\\
\cline{2-2}
& 2. Woche &\\
\cline{2-3}
& 3. Woche & \multirow{2}{*}{\arr Puffer}\\
\cline{2-2}
& 4. Woche &\\
\hline
\end{tabular}
\end{table}
\end{document}