Graphics, Figures & Tables ⇒ Howto put long narrow tables into multiple columns
Howto put long narrow tables into multiple 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?
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Howto put long narrow tables into multiple columns
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
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Howto put long narrow tables into multiple columns
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. [...]
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10