[Tex/LaTex] Multi-page table over two columns

tablestwo-column

I can create tables over both columns in two-column mode using table* with tabular and multi-page tables using longtable or supertabular but I am not able to combine both.

\documentclass[twocolumn]{article}
\usepackage{supertabular}
\usepackage{longtable}

\begin{document}
\begin{supertabular*}{\linewidth}{llllll}
column1 &column2    &column3    &column4    &column5    &column6\\                                                                                                                            
\end{supertabular*}
\end{document}
  • longtable does not work in two-column mode at all ("longtable not in 1-column mode")
  • supertabular* compiles (using \begin{supertabular*}{\linewidth}{...}, as recommended in another Question) but keeps to use one column anyways and overlaps if that space is not sufficient (see MWE above)

Best Answer

Instead of using the supertabular package, which is known to have certain weaknesses, I suggest you use the xtab pacakge and its xtabular and xtabular* environments.

I gather you want the long table is also quite wide and thus needs to span both columns. To obtain this behavior, you need to issue the instruction \onecolumn before \begin{xtabular*}{\textwidth}...}, and you need to issue the instruction \twocolumn after \end{xtabular*}. In order to avoid getting a wretched-looking mid-page page break when LaTeX encounters the \onecolumn directive, I suggest you also load the afterpage package and encase the entire xtabular*-related stuff in an \afterpage{...} instruction. For instance:

\documentclass[twocolumn]{article}
\usepackage{xtab,afterpage}
\usepackage{lipsum}  % for filler text

\begin{document}
\lipsum[1-5]  % filler text

--- here's the call to start an xtabular* environment. 
Execution is deferred until the start of the next page ---

\afterpage{\onecolumn
\begin{xtabular*}{\textwidth}{l@{\extracolsep{\fill}}lllll}
\hline
column1 &column2    &column3    &column4    &column5    &column6\\
%....
column1 &column2    &column3    &column4    &column5    &column6\\
\hline
\end{xtabular*}
\twocolumn
} % end of scope of "\afterpage" directive

\lipsum[6-10] % more filler text
\end{document}

Depending on the length of the table, there may still be some empty space at the bottom of the last page of the table; however, that's usually much less severe a problem than having a bad page immediately before the start of the table.

Related Question