I have been trying for several hours to achieve the following appearance using tabularx
with no success:
- Column 1: Aligned vertical top, horizontal right.
- Column 2: Aligned vertical top, horizontal left.
- Column 3: Aligned vertical top, horizontal left, expanding width (e.g.
X
). - Columns 4,5,6: Aligned vertical bottom, horizontal right
I managed to get last three columns aligned vertically at bottom relative to the 'Long Text' column, but this had undesired effects on the first two column which are now also vertically aligned bottom. How can I align the first two columns vertically at the top while keeping the other columns as they are?
Table Source:
\begin{table}
\renewcommand{\tabularxcolumn}[1]{b{#1}}
\newcolumntype{R}{>{\raggedleft\arraybackslash}p{0.9cm}}
\begin{tabularx}{\textwidth}[ht]{|r|p{2.7cm}|X|R|R|R|}
\hline
\textbf{\texttt \#} &
\textbf{Info} &
\textbf{Long Text} &
{\raggedright \bfseries Col 1 \\(foo.)} &
{\raggedright \bfseries Col 2 \\(bar.)} &
{\raggedright \bfseries Col 3 \\(baz.)}
\\ \hline
1 & \raggedright One, \newline thing & \lipsum*[1] &
1.11 &
2.22 &
3.33 \\ \hline
2 & \raggedright Some, \newline Thing & \lipsum*[1] &
1.55 &
3.66 &
6.99 \\ \hline
\end{tabularx}
\caption{XXX}
\label{tab:xxx}
\end{table}
Table Appearance:
The red arrows show how cell content should move to achieve the desired result.
Update: Clarified the desired result.
1
and2
of the first column to be vertically aligned with the first line of the long text column. Same for the Info column, there theOne
and theSome
should be aligned vertically with theLorem
.