I've created a table whose columns – except for the first one – only contain a single minus or plus sign, so can be very narrow.
The titles of these columns, however, are quite long. I couldn't quite fit them in in a nice way, so decided to rotate them 90 degrees.
Now it looks much better, but I have a new problem – I can't find a way to introduce line breaks in the titles, which makes them stretch the table height way beyond necessary:
Is there a way to limit the height, or manually introduce line breaks into the titles?
Code for the table above:
\documentclass[british]{article}
\usepackage{array}
\usepackage{multirow}
\usepackage{rotating}
\usepackage{babel}
\begin{document}
\begin{table}[!tbh]
\begin{tabular}{|l|>{\centering}p{1.5cm}|>{\centering}p{1.5cm}|>{\centering}p{1.5cm}|>{\centering}p{1.5cm}|>{\centering}p{1.5cm}|}
\hline
\multirow{2}{*}{\textbf{Strategy}} & \multicolumn{5}{c|}{\textbf{Requirement}}\tabularnewline
\cline{2-6} \cline{3-6} \cline{4-6} \cline{5-6} \cline{6-6}
& \begin{turn}{90}
First requirement
\end{turn} & \begin{turn}{90}
Second requirement
\end{turn} & \begin{turn}{90}
And so on
\end{turn} & \begin{turn}{90}
And so forth
\end{turn} & \begin{turn}{90}
And so fifth
\end{turn}\tabularnewline
\hline
\hline
\emph{Bla} & + & -- & -- & -- & +\tabularnewline
\hline
\emph{Bla bla} & -- & -- & + & -- & +\tabularnewline
\hline
\emph{Bla bla bla} & -- & + & + & -- & --\tabularnewline
\hline
\end{tabular}
\caption{\textbf{This is a table.} It shows things.}
\end{table}
\end{document}
Best Answer
OR