6

I have two tables nested inside of a larger table. One of the nested tables is taller than the other, and I'd like to have the two tables line up together at the bottom. I've tried inserting [b] in the outer table, and I've tried declaring the outer table's column containing the shorter inner table as b{0.25\textwidth} instead of l. Neither of these worked. I'm pretty new to LaTeX, so maybe there's something basic that I'm missing.

Here is a minimal version of what I'm working with:

\documentclass{article}
\usepackage{array}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\begin{document}

\begin{tabular*}{0.5\textwidth}{@{\extracolsep{\fill}}ll}
A & B \\ 
\begin{tabular}{rC{5em}}
aaa & 1 \\ 
bbb & 2 \\
ccc & 3 \\     
ddd & 4 \\ 
eee & 5 \\ 
fff & 6 \\ 
\end{tabular} &
\begin{tabular}[b]{rC{5em}}
ddd & 4 \\ 
eee & 5 \\ 
fff & 6 \\ 
\end{tabular} \\ 
\end{tabular*}

\end{document}

This is what my code is giving me:

http://i.stack.imgur.com/wiB17.png

But I'd like to have something like this:

http://i.stack.imgur.com/C7EY6.png

5

The alignment specifier for a tabular could be considered an "anchor point". Use [b] for both the inner tabulars:

enter image description here

\documentclass{article}
\usepackage{array}% http://ctan.org/pkg/array
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\begin{document}

\begin{tabular*}{0.5\textwidth}{@{\extracolsep{\fill}}ll}
  A & B \\ 
  \begin{tabular}[b]{rC{5em}}
    aaa & 1 \\ bbb & 2 \\ ccc & 3 \\ ddd & 4 \\ eee & 5 \\ fff & 6
  \end{tabular} &
  \begin{tabular}[b]{rC{5em}}
    ddd & 4 \\ eee & 5 \\ fff & 6
  \end{tabular} \\ 
\end{tabular*}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.