I want to create a custom table with tabularray package. I have used makecell
and rotating
packages to rotate some of the table cells. Additionally, the length of the rotated cells are set with \setlength\rotheadsize{}
command and as it is expected, it affects all rotated cells. However, I want to set the size individually.
MWE:
\documentclass{article}
\usepackage[paperheight=6in,
paperwidth=5in,
top=10mm,
bottom=20mm,
left=10mm,
right=10mm]{geometry}
\usepackage{tabularx}
\usepackage{tabularray}
\usepackage{makecell}
\usepackage{rotating}
\begin{document}
\begin{table}[ht]
\setlength\rotheadsize{2.0cm}
\renewcommand\theadfont{}
\begin{center}
\begin{talltblr}[
caption = {Example Table},
label = {tbl:example},
]{
width=\linewidth,
colspec={X[1]X[12]|X[1]|X[1]|X[1]|X[1]|},
cell{2}{3-6} = {halign=c,cmd=\rothead},
cell{3-6}{1} = {halign=c,cmd=\rothead},
vline{1}={3-Z}{solid},
vline{2}={3-Z}{solid},
rows = {c},
column{2} = {l},
}
\cline{3-6}
& & \SetCell[c=4]{c} Some Text \\
\cline{3-6}
& & Column 1 & Column 2 & Column 3 & Column 4 \\
\cline{1-6}
\SetCell[r=7]{c} Some longer text & Row 1 & X & X & \\
\cline{2-6}
& Row 2 & X & X & \\
\cline{2-6}
& Row 3 & X & X & \\
\cline{2-6}
& Row 4 & X & X & X \\
\cline{2-6}
& Row 5 & X & & X \\
\cline{2-6}
& Row 6 & X & & X \\
\cline{2-6}
& Row 7 & X & & X \\
\hline
\end{talltblr}
\end{center}
\end{table}
\end{document}
When the size is set for the rotated cells in 2nd row, the text in the 1st column becomes multiline. On the other hand, the height of the 2nd column becomes too high, when the size is set according to 1st column.