Graphics, Figures & TablesDifferent Vertical alignment for each column in a table?

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
CaptainProton
Posts: 15
Joined: Fri Dec 18, 2009 10:54 pm

Different Vertical alignment for each column in a table?

Post by CaptainProton »

Hi, I want to create a table with three columns, the text in the left column should be aligned on top, the right column on the bottom. The center column is stretched so that the whole table fits the page width. How can I do this? I tried the following:

Code: Select all

\documentclass{scrreprt}
\usepackage{tabularx}
\begin{document}
  \begin{tabularx}{\textwidth}{lXr}
    this should be on top  & some text over several lines, more text, more text, more text, more text & this should be on the bottom\\
  \end{tabularx} 
\end{document}
However the right column is aligned on the top (should be bottom). If I include

Code: Select all

\renewcommand{\tabularxcolumn}[1]{b{#1}}
All columns are aligned on the bottom. Does anyone have an idea how I can only have the right column align on the bottom?
Last edited by CaptainProton on Tue Jul 27, 2010 10:13 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Different Vertical alignment for each column in a table?

Post by gmedina »

Hi,

one possible solution (perhaps not the optimal one) would be to use the multirow package:

Code: Select all

\documentclass{scrreprt}
\usepackage{tabularx}
\usepackage{multirow}

\begin{document}

\noindent\begin{tabularx}{\textwidth}{lXr}
  this should be on top  & some text over several lines, more text, more text, more text,
    more text & \multirow{5}{*}{this goes on the bottom}
\end{tabularx} 

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
CaptainProton
Posts: 15
Joined: Fri Dec 18, 2009 10:54 pm

Different Vertical alignment for each column in a table?

Post by CaptainProton »

gmedina wrote:one possible solution (perhaps not the optimal one) would be to use the multirow package
Thank you very much! This works for me
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Different Vertical alignment for each column in a table?

Post by localghost »

Marking a topic as solved does not mean just to mark the last post, but editing the initial one as described in Section 3 of the Board Rules (to be read before posting). This applies to all the topics you initiated. So, please catch up on that.


Best regards
Thorsten
Post Reply