1

I want use a vertical text across the rows A-E (see picture). I tried to use the multirow command but somehow it does not work "\multirow{2}{*}{\RotText{Kriterien}}". What am I doing wrong??

\documentclass[twocolumn]{article}
\usepackage{tabularx}
\usepackage{array}
\usepackage{rotating}
\usepackage{lipsum}

\renewcommand\tabularxcolumn[1]{>{\small}m{#1}}
\newcolumntype{Y}{>{\centering\arraybackslash}X}
\newcommand\RotText[1]{\rotatebox{90}{\parbox{3.5cm}{\centering#1}}}

%\newlength{\arrayrulewidthOriginal}
\newcommand{\Cline}[2]{%
\noalign{\global\setlength{\arrayrulewidthOriginal}{\arrayrulewidth}}%
\noalign{\global\setlength{\arrayrulewidth}{#1}}\cline{#2}%
\noalign{\global\setlength{\arrayrulewidth}{\arrayrulewidthOriginal}}}

\begin{document}

{
\setlength\tabcolsep{1pt}
\begin{tabularx}{\columnwidth}{|Y|l|Y|Y|Y|Y|Y|Y|Y|Y|Y|}
\cline{3-9}
\multicolumn{1}{c}{}& & &\multicolumn{6}{c|}{text}\\
\cline{4-9}
\multicolumn{1}{c}{} & & &
\multicolumn{3}{c|}{text}  & 
\multicolumn{3}{c|}{text} \\
\cline{4-9}

\multicolumn{1}{c}{}&
\multicolumn{1}{c|}{} & 
\RotText{some text} &
\RotText{Some really long text} & 
\RotText{Some really long text} & 
\RotText{Some really long text} & 
\RotText{Some really long text} & 
\RotText{Some really long text} & 
\RotText{Some really long text}  \\ \hline
%\noalign{\hrule height 1pt}


 \RotText{Text across A-E} & A & 21 & 11 & 44 & 11 & 54 & 34 & 54 \\ \hline
& B & 11 & 11 & 44 & 11 & 54 & 34 & 54 \\ \hline
& C & 11 & 11 & 44 & 11 & 54 & 34 & 54 \\ \hline
& D & 11 & 11 & 44 & 11 & 54 & 34 & 54 \\ \hline
& E & 11 & 11 & 44 & 11 & 54 & 34 & 54 \\ \hline
\end{tabularx}
}

\end{document}

enter image description here

1 Answer 1

1

Here's the code:

\documentclass[twocolumn]{article}
\usepackage{tabularx}
\usepackage{array}
\usepackage{rotating}
\usepackage{lipsum}
\usepackage{multirow}
\renewcommand\tabularxcolumn[1]{>{\small}m{#1}}
\newcolumntype{Y}{>{\centering\arraybackslash}X}
\newcommand\RotText[1]{\rotatebox{90}{\parbox{3.5cm}{\centering#1}}}

%\newlength{\arrayrulewidthOriginal}
\newcommand{\Cline}[2]{%
\noalign{\global\setlength{\arrayrulewidthOriginal}{\arrayrulewidth}}%
\noalign{\global\setlength{\arrayrulewidth}{#1}}\cline{#2}%
\noalign{\global\setlength{\arrayrulewidth}{\arrayrulewidthOriginal}}}

\begin{document}

{
\setlength\tabcolsep{1pt}
\setlength\extrarowheight{1.8pt} %new code
\begin{tabularx}{\columnwidth}{|Y|l|Y|Y|Y|Y|Y|Y|Y|Y|Y|}
\cline{3-9}
\multicolumn{1}{c}{}& & &\multicolumn{6}{c|}{text}\\
\cline{4-9}
\multicolumn{1}{c}{} & & &
\multicolumn{3}{c|}{text}  & 
\multicolumn{3}{c|}{text} \\
\cline{4-9}

\multicolumn{1}{c}{}&
\multicolumn{1}{c|}{} & 
\RotText{some text} &
\RotText{Some really long text} & 
\RotText{Some really long text} & 
\RotText{Some really long text} & 
\RotText{Some really long text} & 
\RotText{Some really long text} & 
\RotText{Some really long text}  \\ \hline
%\noalign{\hrule height 1pt}


 \multirow{-2}{*}{\RotText{Text across A-E}} & A & 21 & 11 & 44 & 11 & 54 & 34 & 54 \\ \cline{2-9}
& B & 11 & 11 & 44 & 11 & 54 & 34 & 54 \\ \cline{2-9}
& C & 11 & 11 & 44 & 11 & 54 & 34 & 54 \\ \cline{2-9}
& D & 11 & 11 & 44 & 11 & 54 & 34 & 54 \\ \cline{2-9}
& E & 11 & 11 & 44 & 11 & 54 & 34 & 54 \\ \hline
\end{tabularx}
}

\end{document}

enter image description here

I added some extra row height because the text was too long for the available space. If your actual text is shorter you can remove the extra row height

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.