1

I have 3 pages long table in my latex two column document. I used longtable package it shows error cant use is two column mode and when I use

> \usepackage{supertabular}

The table become overlap rather than in 3 Separate pages , It looks like here [![enter image description here][1]][1]

Code:

   \begin{center}
\begin{supertabular}{|p{4cm}|l|p{3cm}|l|l|p{2cm}|l|}
\caption{A sample long table.} \label{tab:long} \\

\hline \multicolumn{1}{|c|}{\textbf{Category}} & \multicolumn{1}{c|}{\textbf{Diagnosis}} & \multicolumn{1}{c|}{\textbf{Frequency}}& \multicolumn{1}{c|}{\textbf{Location }} \\ \hline 
\endfirsthead

\multicolumn{3}{c}%
{{\bfseries \tablename\ \thetable{} -- continued from previous page}} \\
\hline \multicolumn{1}{|c|}{\textbf{Category}} & \multicolumn{1}{c|}{\textbf{Diagnosis}} & \multicolumn{1}{c|}{\textbf{Frequency}}& \multicolumn{1}{c|}{\textbf{Location }} \\ \hline 
\endhead

\hline \multicolumn{3}{|r|}{{Continued on next page}} \\ \hline
\endfoot

\hline \hline
\endlastfoot

\textit{\textbf{\footnotesize bone \& bone bone}}& bone & 7(0) & bone , bone , bone\\
 & bone & 1 (0) & bone \\
bone & bone & 0(0) \\
 & bone & 0(0) & bone , bone , bone \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
\end{supertabular}
\end{center}
4
  • Welcome to TeX.SE! Your table is apparently to wide that can be fit in one column. at least you must change page layout to one column. For tables in one column see L.J.R. answer on tex.stackexchange.com/questions/161431
    – Zarko
    Commented Mar 25, 2023 at 7:14
  • Please tell us which document class you employ and how wide the textblock is.
    – Mico
    Commented Mar 25, 2023 at 7:51
  • 1
    There should be an option to delete the question. It's better to use that than to delete the content, which leaves all of the answers here. Commented Aug 8, 2023 at 21:40
  • Is the user gone today? Did s/he post an almost identical topic/question?
    – MS-SPO
    Commented Aug 10, 2023 at 12:16

2 Answers 2

1
  • Instead of code fragment you should provide MWE (Minimal Working Example), a small but complete document with your table, which we can test as it is.
  • Your code framned has more issues:
    • your table is to wide that can be fit in one column
    • you determine six columns but use only four
    • how numbers are formating

Possible solution based on guessing ...

\documentclass[twocolumn]{article}
%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\usepackage{lipsum}% For dummy text. Don't use in a real document

\usepackage{tabularray}
\UseTblrLibrary{booktabs}


\begin{document}
\lipsum[1-3]
\onecolumn
    \begin{longtblr}[
caption = {A sample long table.},
  label = {tab:long}
                    ]{vlines,
                      colspec = {X[l] X[l] l X[l] },
                      %cells   = {font=\footnotesize},
                      row{1}  = {font=\bfseries},
                      rowhead=1
                      }
    \toprule
Category    & Diagnosis & Frequency & Location      \\ 
    \midrule
\textit{\textbf{\footnotesize bone \& bone}}
    & bone
        & 0(0) 
            & bone , bone , bone\\
    & bone
        & 0 (0.) & bone \\ bone 
    & bone 
        & 0(0) \\
            & bone
                & 0(0) 
                    & bone , bone , bone \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
    \bottomrule
    \end{longtblr}
    
\twocolumn
\lipsum[4-7]
\end{document}

[![enter image description here][1]][1]

[![enter image description here][2]][2]

0

Here's another solution that builds on a lot of guesswork as the OP hasn't specified lots of important document parameters (such as the document class, with width and height of the textblock, the document font and font size, etc). The solution employs the xltabular package and its eponymous environment, which combines the strengths of the longtable and tabularx environments. It also employs the afterpage package to delay the start of the single-column material until the start of the next page.

Note that I've also eliminated the table's vertical lines as they don't do anything useful. Automatic line breaking is enabled in three of the four columns, as that's what's needed to be able to fit the table inside the textblock. And, for further make it easy to discern cell contents and cell boundaries, hanging indentation of lines beyond the first line in a cell is enabled as well.

[![enter image description here][1]][1]

[![enter image description here][2]][2]

\documentclass[twocolumn]{article}
\usepackage{xltabular,booktabs,afterpage,lipsum}
\newcolumntype{L}{%
  >{\raggedright\arraybackslash\hangafter=1\hangindent=1em}X}

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

\afterpage{%
\onecolumn % switch to single-column mode

\begin{xltabular}{\textwidth}{@{} LLcL @{}}
\caption{A sample very long table.} \label{tab:long} \\

\toprule 
\textbf{Category} & \textbf{Diagnosis} & \textbf{Frequency} & \textbf{Location} \\ 
\midrule 
\endfirsthead

\multicolumn{4}{@{}l}{\tablename\ \thetable, continued} \\[0.5ex]
\toprule 
\textbf{Category} & \textbf{Diagnosis} & \textbf{Frequency} & \textbf{Location} \\ 
\midrule  
\endhead

\midrule 
\multicolumn{4}{r@{}}{(Continued on next page)} \\ 
\endfoot

\bottomrule 
\endlastfoot

\textit{\textbf{bone}} & 
bone & 0 (0) & 
bone, bone, bone \\
& bone & 0 (0) & bone \\
\addlinespace
bone & bone & 0 (0) & \\
& bone & 0 (0) & bone, bone, bone \\
\addlinespace
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
\end{xltabular}
\twocolumn } % back to two-column mode (and force a page break)

\lipsum[5-55] % more filler text

\end{document}

You must log in to answer this question.