Tell me more ×
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

1 Answer

up vote 8 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 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
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

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.