I would like to set the first and the second column of the shown tabularx
table to automatically rotate any text inside a single cell of one row or a single cell consisting of cells joined by \multirow
and to center it both vertically and horizontally while allowing to adjust the height of the columns by \\[height]
or other method with top vertical alignment of the content.
Just to explain the rule through the first column, I also need \noalign{\hrule height 1pt}
to behave like \cline{2-4}
, hence not affecting the first column, but that is for another question, I guess.
Minimal working example:
\documentclass[11pt, a4paper]{article}
\usepackage{lmodern}
\usepackage{array}
\usepackage{graphicx}
\usepackage{multirow}
\usepackage{tabularx}
\begin{document}
\scriptsize
\setlength{\extrarowheight}{0.2em}
\noindent\begin{tabularx}{\textwidth}{!{\vrule width 1pt} p{0.3cm} !{\vrule width 1pt} p{0.5cm} | p{4cm} | X !{\vrule width 1pt}}
\noalign{\hrule height 1pt}
\multirow{4}{*}{\rotatebox{90}{Ten}}&\multirow{2}{*}{\rotatebox{90}{Eight}} & One & Two\\[0.5cm] \cline{3-4}
& & Three & Four\\[1cm] \noalign{\hrule height 1pt}
&\multirow{2}{*}{\rotatebox{90}{Nine}} & Five & Six\\[0.5cm] \cline{3-4}
& & \multicolumn{2}{ l !{\vrule width 1pt}}{Seven}\\[1cm]
\noalign{\hrule height 1pt}
\end{tabularx}
\end{document}
Fig. 1: The current state.
Fig. 2: The approximate objective (digitally manipulated in a graphics editing program).