I've been fiddling with a table layout where some cells contain very little text while others may need multiple lines, and I can't seem to get it readable and nice-looking.
MWE:
\documentclass{article}
\usepackage{booktabs}
\usepackage{array}
\usepackage{rotating}
\begin{document}
\rotatebox{90}{
\begin{tabular}{l@{\hspace{1em}}>{\raggedright}p{.2\textheight}>{\raggedright}p{.2\textheight}>{\raggedright}p{.2\textheight}>{\raggedright\arraybackslash}p{.2\textheight}}
\toprule
\multicolumn{2}{l}{heading 1} & heading 2 & heading 4 & heading 4 \\
\midrule
\multicolumn{2}{l}{sub-heading} & & & \\
\cmidrule(lr){1-5} & long long long long long long long long long long long long text & a & b & c \\
& x & long long long long long long long long long text & long long long long long long long long long text & y \\
& short & short & short & short \\
& x & y & z & long long long long long long long long long text \\
\bottomrule
\end{tabular}
}
\end{document}
The output is hardly readable, especially for the third line (short/short/short/short), it is nearly impossible to distinguish whether its elements are one line in the table or part of the (depending on the column) previous/next line. I've played around with \arraystretch
, but then the header lines had too much spacing and the readability was not really increased.