I have an issue with the following tabularx code. I am trying to rotate some longer text by 90 degrees so that I can keep the column width small. I have reduced the number of columns for this example but in my actual tex file I have 6 columns, which gets rather tight.
The problem I have with this is that the first column header is not exactly flushed left, but one line right of that:
\begin{table}
\begin{tabularx}{\textwidth}{|X|X|}
\hline
\multicolumn{1}{|l|}{
\rotatebox{90}{
\parbox {2cm}{\flushleft \bfseries Foo \\ (Foo Bar and Baz)} }} &
\multicolumn{1}{l|}{
\rotatebox{90}{\bfseries Something} } \\\hline
Yes & No\footnote{\url{https://example.com}} \\\hline
\end{tabularx}
\end{table}
When I omit the \flushleft in the \parbox then the text is justified:
\begin{table}
\begin{tabularx}{\textwidth}{|X|X|}
\hline
\multicolumn{1}{|l|}{%
\rotatebox{90}{ \parbox {2cm}{
\bfseries Foo \\ (Foo Bar and Baz)} }} &
\multicolumn{1}{l|}{
\rotatebox{90}{ \bfseries Something} } \\\hline
Yes & No\footnote{\url{https://example.com}} \\\hline
\end{tabularx}
\end{table}
How can I get the text aligned to the bottom and to the left? Or otherwise is there some other best practice to deal with long header text?


\rotatebox{90}{ \parbox {2cm}{inserts two space characters you do not want:\rotatebox{90}{\parbox {2cm}{\raggedright– David Carlisle Oct 27 '16 at 09:24