Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am using multicol to make a two-column document using the book document class. I have a long tabular that I want to break where the page breaks and then continue in the next column.

I could split it into two tables, but I want their width and such to be the same. I've tried with longtable but can't get it to work.

I basically want the table to split and arrange itself into two columns just like normal text does.

Edit: Sorry for the lack of information. With just 1 column it works fine with longtable, but when I use multicols it breaks down and just continues outside the page. I also get an error while compiling.

Package longtable Error: longtable not in 1-column mode.

This is a simplification of my code:

\documentclass[11pt,a4paper]{article}

\usepackage{multicol}
\usepackage{longtable}

\begin{document}

\begin{multicols}{2}

\begin{longtable}{ccc}
Header of first column & Header of second column \\
\endhead
Table cell 1, 1 & Table cell 1, 2 \\
Table cell 2, 1 & Table cell 2, 2 \\
Table cell 1, 1 & Table cell 1, 2 \\
...
...
\end{longtable}

\end{multicols}

\end{document}

What it looks like

I hope this is enough information. Any thoughts?

share|improve this question
    
"I've tried with longtable but can't get it to work." is very little information. What exactly did not work with longtable? And are you able to post a small, but complete example code, so we are able to find the problem? –  Axel Sommerfeldt Jul 19 '11 at 15:04
    
possible duplicate of multicolumn long table or enumeration –  lockstep Jul 19 '11 at 15:21

2 Answers 2

up vote 13 down vote accepted

Use the \twocolumn format, then you can use the package supertabular

\documentclass[11pt,a4paper]{article}
\usepackage{supertabular}

\begin{document}
\twocolumn
\tablehead{Header of first column & Header of second column \\}

\begin{supertabular}{ccc}
Table cell 1, 1 & Table cell 1, 2 \    Table cell 2, 1 & Table cell 2, 2 \    Table cell 1, 1 & Table cell 1, 2 \    ...
...
\end{supertabular}

\end{document}

together with the package multicols you can only use the tabbing environment.

share|improve this answer
1  
+1 Was supertabular created to replace longtable? –  xport Jul 20 '11 at 15:08
    
no, it is another package. There are more packages which support a pagebreak –  Herbert Jul 20 '11 at 15:32
1  
That's great. I did not know about supertabular. A shame it can't be used with multicols, but this works for my purpose. –  Petter Jul 20 '11 at 15:51
    
+1 for the comment on supertabular not working with multicols. it's too bad but it helps to know in advance before wasting hours trying to tweak the settings... –  mmdanziger Jan 26 '12 at 10:03

A way to use longtable within multicols is described in one of the answers to Balancing long table inside multicol in LaTeX. As multicol does balancing after the table is processed some of the features (like repeated table headings) will not work though.

A way to use supertabular with multicols is described in Trick Supertabular into Multicols in new command.

The difference between the two table environments is that supertabular is calculating the table cell width anew for each column while longtablekeeps them uniform.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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