2

I have a long, thin table with titled sections. It didn't fit on one page so I split it in two parts of roughly equal length and but these in a another tabular environment. I am happy with the design except that I want the right hand column to have vertically evenly spaced sections, with the first one aligned to the top and the last one aligned to the bottom. Basically I want the \separator command in the code below to be something like \vfill

My attempts below I tried to define it as \parbox{\linewidth}{\vfill}\\ since \vfill\\ by itself didn't work. I could do the calculation manually but the actual table is more complicated that this example, with sub-sections and stuff, and would have to be redone every time I edit it.

Any suggestions?

\documentclass{book}
\usepackage{booktabs}
\begin{document}


\begin{table}
\newcommand\separator{\parbox{\linewidth}{\vfill}\\}
\center
\begin{tabular}{@{}ll@{}}
\toprule
\begin{tabular}{ll}
\multicolumn{2}{c}{\scshape title}\\
\addlinespace
Text & AAA\\
Text & AAA\\
Text & AAA\\
Text & AAA\\
Text & AAA\\
Text & AAA\\
Text & AAA\\
Text & AAA\\
Text & AAA\\
Text & AAA\\
Text & AAA\\

\addlinespace


\multicolumn{2}{c}{\scshape title}\\
\addlinespace
Text & AAA\\
Text & AAA\\
Text & AAA\\
Text & AAA\\
Text & AAA\\
Text & AAA\\
Text & AAA\\
Text & AAA\\
Text & AAA\\
Text & AAA\\
Text & AAA\\

\end{tabular}
&
\begin{tabular}{ll}
\multicolumn{2}{c}{\scshape title}\\
\addlinespace
Text & AAA\\
Text & AAA\\
Text & AAA\\
Text & AAA\\

\separator

\multicolumn{2}{c}{\scshape title}\\
\addlinespace
Text & AAA\\
Text & AAA\\
Text & AAA\\
Text & AAA\\

\separator

\multicolumn{2}{c}{\scshape title}\\
\addlinespace
Text & AAA\\
Text & AAA\\
Text & AAA\\
Text & AAA\\

\separator

\multicolumn{2}{c}{\scshape title}\\
\addlinespace
Text & AAA\\
Text & AAA\\
Text & AAA\\
Text & AAA\\
\end{tabular}\\
\bottomrule
\end{tabular}
\end{table}

\end{document}

enter image description here

EDIT: I used David's elegant solution and set the text columns as p, all with the same width. The multicols environments I placed in a minipage and then put that in turn in \begin{tabular}{c} since I wanted encapsulate the whole thing encapsulated in \toprule and \bottomrule that are modified globally. The code is a little messy but the result is very pretty.

1 Answer 1

3

note that \center is the internal implementation of \begin{center} and not intended to be used as a command form (and if it is used, should be paired with \endcenter) \centering is the intended command form.

Spacing and alignment could be adjusted to requirements, but something like:

enter image description here

\documentclass{book}
\usepackage{booktabs,multicol}
\begin{document}


\begin{table}
\hrule
\begin{multicols}{2}\setlength\parskip{12pt plus 1fill}
\centering
\begin{tabular}{ll}
\multicolumn{2}{c}{\scshape title}\\
\addlinespace
Text & AAA\\
Text & AAA\\
Text & AAA\\
Text & AAA\\
Text & AAA\\
Text & AAA\\
Text & AAA\\
Text & AAA\\
Text & AAA\\
Text & AAA\\
Text & AAA\\
\end{tabular}

\begin{tabular}{ll}
\multicolumn{2}{c}{\scshape title}\\
\addlinespace
Text & AAA\\
Text & AAA\\
Text & AAA\\
Text & AAA\\
Text & AAA\\
Text & AAA\\
Text & AAA\\
Text & AAA\\
Text & AAA\\
Text & AAA\\
Text & AAA\\
\end{tabular}

\begin{tabular}{ll}
\multicolumn{2}{c}{\scshape title}\\
\addlinespace
Text & AAA\\
Text & AAA\\
Text & AAA\\
Text & AAA\\
\end{tabular}

\begin{tabular}{ll}
\multicolumn{2}{c}{\scshape title}\\
\addlinespace
Text & AAA\\
Text & AAA\\
Text & AAA\\
Text & AAA\\
\end{tabular}

\begin{tabular}{ll}
\multicolumn{2}{c}{\scshape title}\\
\addlinespace
Text & AAA\\
Text & AAA\\
Text & AAA\\
Text & AAA\\
\end{tabular}

\begin{tabular}{ll}
\multicolumn{2}{c}{\scshape title}\\
\addlinespace
Text & AAA\\
Text & AAA\\
Text & AAA\\
Text & AAA\\
\end{tabular}
\end{multicols}
\hrule
\end{table}

\end{document}
2
  • The text given as Text is of different lengths. I'd rather not split each column into different tabulars since this would lead to the right columns (AAA) being non-aligned. One solution could perhaps be to have the first column in each column (if you see what I mean) be p{<some length>}. It would be easier though to have cells with \vfill of some kind.
    – Andreas
    Oct 18, 2014 at 11:03
  • @Andreas a tabular makes a box so all glue is frozen to its natural length which is 0pt for \vfill. Oct 18, 2014 at 11:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .