For reference, this is what I am trying to achieve:
This is what my current table looks like:
This is the problem I am trying to solve (making the class names longer breaks the table):
Here are the the required packages to reproduce the table:
\usepackage{rotating}
\usepackage{multirow}
\usepackage{booktabs}
And here is the code for the table that we generated with my butler ChatGPT:
\begin{table*}[ht]
\centering
\footnotesize
\begin{tabular}{lp{4cm}ccp{5cm}}
\toprule
\multirow{2}{*}{\rotatebox[origin=c]{90}{}} & \multicolumn{1}{c}{\textbf{Test TYPE and description}} & \multicolumn{2}{c}{\textbf{Failure Rate (\%)}} & \multicolumn{1}{c}{\textbf{Example test cases \& \colorbox{gray}{expected behavior}}} \\
& & \textbf{BERT} & \textbf{BiLSTM} & \\
\midrule
\multirow{3}{*}{\rotatebox[origin=c]{90}{Predicate Identification}} & Test 1 description & 10 & 30 & Expected behavior for Test 1 \\
& Test 2 description & 15 & 35 & Expected behavior for Test 2 \\
& Test 3 description & 20 & 40 & Expected behavior for Test 3 \\
\midrule
\multirow{3}{*}{\rotatebox[origin=c]{90}{Class B}} & Test 4 description & 5 & 15 & Expected behavior for Test 4 \\
& Test 5 description & 10 & 20 & Expected behavior for Test 5 \\
& Test 6 description & 15 & 25 & Expected behavior for Test 6 \\
\bottomrule
\end{tabular}
\caption{Example of a table with rotated row headings, separated rows, one value per group, and a description of the test for each row.}
\label{tab:example}
\end{table*}
I tried adding '\\' to the vertical row headers, but it did not work (still stayed as one long line)
Is there a way to ensure that the table resizes dynamically? And how about keeping some of the Classes with fewer tests horizontal to save space?