2

I have the following table:

\documentclass{article}
\usepackage{graphicx}
\usepackage{multirow}
\usepackage{adjustbox}
\usepackage{rotating}

\begin{document}


\begin{table}[htbp]
\begin{adjustbox}{width=\textwidth,totalheight=\textheight,keepaspectratio}
\begin{tabular}{| c | l | c | c | c | c | c | c | c | c | c | c | c | c | c | c | c | c |}
\hline
A & B & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 & 16\tabularnewline
\hline
\multirow{2}{*}{\begin{sideways}EFGH\end{sideways}} & abaadfgd & & & & & & & & & & & & & & & &\tabularnewline
\cline{2-18}
& afgdfgadg & & & & & & & & & & & & & & & &\tabularnewline
\cline{2-18}
& afgfdagdfgdfg & & & & & & & & & & & & & & & &\tabularnewline
\hline
\multirow{2}{*}{\begin{sideways}XYZ\end{sideways}} & dagdgadg & & & & & & & & & & & & & & & &\tabularnewline
\cline{2-18}
& adfgadgadg & & & & & & & & & & & & & & & &\tabularnewline
\cline{2-18}
& adfgfadgdafg & & & & & & & & & & & & & & & &\tabularnewline
\cline{2-18}
& afgdagdfgdg & & & & & & & & & & & & & & & &\tabularnewline
\hline
\end{tabular}
\end{adjustbox}
\end{table}

\end{document}

This results in a table like that:

enter image description here

I would like to vertically center the text in the first column, but I can't manage to do it. How should I proceed?

0

1 Answer 1

3

use the correct numbers of lines for \multirow:

\documentclass{article}
\usepackage{graphicx}
\usepackage{multirow}
\usepackage{adjustbox}

\begin{document}
\begin{adjustbox}{width=\textwidth,totalheight=\textheight,keepaspectratio}
\begin{tabular}{| c | l | c | c | c | c | c | c | c | c | c | c | c | c | c | c | c | c |}
\hline
A & B & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 & 16\tabularnewline
\hline
\multirow{3}{*}{\rotatebox{90}{\kern-0.3em EFGH}} & abaadfgd & & & & & & & & & & & & & & & &\tabularnewline
\cline{2-18}
& afgdfgadg & & & & & & & & & & & & & & & &\tabularnewline
\cline{2-18}
& afgfdagdfgdfg & & & & & & & & & & & & & & & &\tabularnewline
\hline
\multirow{4}{*}{\rotatebox{90}{\kern-0.3em XYZ}} & dagdgadg & & & & & & & & & & & & & & & &\tabularnewline
\cline{2-18}
& adfgadgadg & & & & & & & & & & & & & & & &\tabularnewline
\cline{2-18}
& adfgfadgdafg & & & & & & & & & & & & & & & &\tabularnewline
\cline{2-18}
& afgdagdfgdg & & & & & & & & & & & & & & & &\tabularnewline
\hline
\end{tabular}
\end{adjustbox}

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .