Is there an easy way to break long narrow tables into two (or possibly more) columns (i.e. without manually rearranging the columns)?
In the following example you can see that there is a lot of wasted space, because there is a long table with a lot of white space next to it
(and \twocolumn
didn't work as I would have liked it to...):
\documentclass{article}
\begin{document}
\begin{table}
\centering
\twocolumn
\begin{tabular}{cc}
\hline
thing & mapsto \\
\hline
foo 0 & bar 2 \\
foo 1 & bar 3 \\
foo 2 & bar 4 \\
foo 3 & bar 5 \\
foo 4 & bar 6 \\
foo 5 & bar 7 \\
foo 6 & bar 8 \\
foo 7 & bar 9 \\
foo 8 & bar 10 \\
foo 9 & bar 11 \\
foo 10 & bar 12 \\
foo 11 & bar 13 \\
foo 12 & bar 14 \\
foo 13 & bar 15 \\
foo 14 & bar 16 \\
foo 15 & bar 17 \\
foo 16 & bar 18 \\
foo 17 & bar 19 \\
foo 18 & bar 20 \\
foo 19 & bar 21 \\
\hline
\end{tabular}
\caption{What is this?}
\onecolumn
\end{table}
Pellentesque sed posuere magna. Ut pellentesque dictum posuere. Mauris at justo ipsum. Maecenas sit amet neque erat, nec euismod nisi. Nullam posuere convallis massa vel luctus. Etiam vestibulum semper lectus, sed ultrices leo aliquet sit amet. Vestibulum in lorem vitae magna scelerisque porttitor ut volutpat dui. Nulla risus felis, molestie et tincidunt sit amet, ullamcorper vestibulum erat. Pellentesque bibendum porttitor velit, at tempor erat sollicitudin at. Sed nec nunc lacus. Sed sollicitudin sollicitudin risus sit amet mollis. Nam posuere tincidunt lacus, ut placerat arcu pharetra at. Proin tempus, orci sed consequat consequat, nulla augue tempus augue, vel fermentum mi augue eget odio.
\end{document}
So in the end the result should look like what I would get by manually changing the above table to:
\begin{tabular}{ccp{1em}cc}
\hline
thing & mapsto && thing & mapsto \\
\hline
foo 0 & bar 2 && foo 10 & bar 12 \\
foo 1 & bar 3 && foo 11 & bar 13 \\
...
I am using booktabs
so it would be nice if a potential solution were compatible to this package.
(A related question is Two Column Layout for Tables where I got the idea with \twocolumn
from.)
collcell
package. To simplify the task it might be helpful to specify how many times the table is to be broken, and which rows are to be repeated at the top.