3

My document has 2 columns. I am trying to create a table that has a single column (i.e. a single entry in each line) but can split across both columns of the document, and even go to the next page. I am using supertabular, which I only half understand, and at this point, I have written this

\documentclass[12pt,aps,prb,twocolumn, nofootinbib]{report}
\usepackage[utf8]{inputenc}
\usepackage{supertabular,booktabs}
\usepackage{array}
\begin{document}
\begin{center}
\tablefirsthead{%
\hline
\multicolumn{1}{|c|}{\tbsp Number}
\hline}
%

\tablehead{%
\hline
\multicolumn{1}{|c|}{\tbsp Number}
\hline}
%
\tabletail{%
\midrule \multicolumn{1}{r}{{Continued on next column}} \\ \midrule}

\begin{supertabular}{l}
    \hline
    42\\ \hline
    347\\ \hline
\end {supertabular}
\end{center}
\end{document}

which does not work, instead it gives me a lot of errors and it is unable to compile. What am I doing wrong, and is there a better/simpler way of doing this?

  • What do you mean by "it doesn't work"? Also please extend your snippet to a complete document that can be compiled and tested directly. – Ulrike Fischer Jul 19 at 9:16
  • Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – Alessandro Cuttin Jul 19 at 9:33
4

You are missing a few \\ - \hline should come always after a it. And \tbsp is not defined, so I removed it. With this changes your example compiles fine:

\documentclass[12pt,aps,prb,twocolumn, nofootinbib]{report}
\usepackage[utf8]{inputenc}
\usepackage{supertabular,booktabs}
\usepackage{array}
\begin{document}
\begin{center}
\tablefirsthead{%
\hline
\multicolumn{1}{|c|}{ Number}
\\\hline}
%%
%
\tablehead{%
\hline
\multicolumn{1}{|c|}{ Number}
\\\hline}
%%
\tabletail{%
\midrule \multicolumn{1}{r}{{Continued on next column}} \\ \midrule}

\begin{supertabular}{l}
    \hline
    42\\ \hline
    347\\ \hline
\end {supertabular}
\end{center}
\end{document}
3

If your table will fit in single page, then you can try with:

\begin{table*}
\caption{...}
\begin{tabular}{..}
...
...
\end{tabular}
\end{table*}

No need to go with supertabular or longtable, which are mainly used for tables which exceeds more than a page...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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