Consider the following table of three columns.
\begin{tabular}{ccc}
Ind & Number & Topic \\
1 & 1 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1 \\
2 & 2 & 2 \\
2 & 2 & 2 \\
2 & 2 & 2 \\
2 & 2 & 2 \\
2 & 2 & 2 \\
2 & 2 & 2 \\
2 & 2 & 2 \\
2 & 2 & 2 \\
2 & 2 & 2 \\
2 & 2 & 2 \\
3 & 3 & 3 \\
3 & 3 & 3 \\
3 & 3 & 3 \\
3 & 3 & 3 \\
3 & 3 & 3 \\
3 & 3 & 3 \\
3 & 3 & 3 \\
3 & 3 & 3 \\
3 & 3 & 3 \\
...etc...
10 & 10 & 10 \\
\end{tabular}
This is a long narrow table, so firstly we need to use the xtab package to break across multiple pages. However, each page then is very empty... it would be nice to place into columns and automatically balance them.
What I would to do is something like the following code:
\begin{multicols}{3}
\tablehead{Ind & Number & Topic \\}
\begin{xtabular}{ccc}
..entries as above..
\end{xtabular}
\end{multicols}
... but this doesn't work, everything is in just one column.
Using the \twocolumn option with xtab alone works, but I'd like three columns.
Obviously, I could manually typeset the table into three columns - balancing them manually... but it's then a nightmare to add new rows.
Any thoughts?
Graphics, Figures & Tables ⇒ Howto put long narrow tables into multiple columns
NEW: TikZ book now 40% off at Amazon.com for a short time.

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Howto put long narrow tables into multiple columns
At first, please use the code environment from the button list right above the input window to tag longer pieces of source code.
I suggest just to split the table into three parts. You can use three separate tabular environments or a single one with separated columns.
Best regards and welcome to the board
Thorsten
I suggest just to split the table into three parts. You can use three separate tabular environments or a single one with separated columns.
Code: Select all
\begin{table}[!ht]
\caption{A narrow table split into three parts}\label{tab:threeparts}
\centering
\begin{tabular}{ccc}
Ind & Number & Topic \\ \hline
1 & 1 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1 \\
\end{tabular}
\hspace{1em}
\begin{tabular}{ccc}
Ind & Number & Topic \\ \hline
2 & 2 & 2 \\
2 & 2 & 2 \\
2 & 2 & 2 \\
2 & 2 & 2 \\
2 & 2 & 2 \\
2 & 2 & 2 \\
2 & 2 & 2 \\
2 & 2 & 2 \\
2 & 2 & 2 \\
2 & 2 & 2 \\
\end{tabular}
\hspace{1em}
\begin{tabular}{ccc}
Ind & Number & Topic \\ \hline
3 & 3 & 3 \\
3 & 3 & 3 \\
3 & 3 & 3 \\
3 & 3 & 3 \\
3 & 3 & 3 \\
3 & 3 & 3 \\
3 & 3 & 3 \\
3 & 3 & 3 \\
3 & 3 & 3 \\
3 & 3 & 3 \\
\end{tabular}
\end{table}
\begin{table}[!ht]
\caption{A table consisting of three tables}\label{tab:threetables}
\centering
\begin{tabular}{ccc@{\qquad}ccc@{\qquad}ccc}
Ind & Number & Topic & Ind & Number & Topic & Ind & Number & Topic\\ \hline
1 & 1 & 1 & 2 & 2 & 2 & 3 & 3 & 3 \\
1 & 1 & 1 & 2 & 2 & 2 & 3 & 3 & 3 \\
1 & 1 & 1 & 2 & 2 & 2 & 3 & 3 & 3 \\
1 & 1 & 1 & 2 & 2 & 2 & 3 & 3 & 3 \\
1 & 1 & 1 & 2 & 2 & 2 & 3 & 3 & 3 \\
1 & 1 & 1 & 2 & 2 & 2 & 3 & 3 & 3 \\
1 & 1 & 1 & 2 & 2 & 2 & 3 & 3 & 3 \\
1 & 1 & 1 & 2 & 2 & 2 & 3 & 3 & 3 \\
1 & 1 & 1 & 2 & 2 & 2 & 3 & 3 & 3 \\
1 & 1 & 1 & 2 & 2 & 2 & 3 & 3 & 3 \\
\end{tabular}
\end{table}
Best regards and welcome to the board
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Howto put long narrow tables into multiple columns
Oh yeah... didn't notice the code tags. Opps.
Manually breaking it into separate tabulars is a good solution... but it's not the best.
I'm not familiar enough with the code of multicols to work out how to get it to work with supertabular - was hoping someone here might know.
Thanks for the reply.
Manually breaking it into separate tabulars is a good solution... but it's not the best.
I'm not familiar enough with the code of multicols to work out how to get it to work with supertabular - was hoping someone here might know.
Thanks for the reply.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Howto put long narrow tables into multiple columns
It stays the best until there is a better one. If you make a find, post your solution here.simon wrote:[...] Manually breaking it into separate tabulars is a good solution... but it's not the best. [...]
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10