I have to insert a very long table in the tex file, for a two-column class, for example: \documentclass[5p]{elsarticle}.
The problem is that: the longtable package does not work in this class (as it is a twocolumn class). Also, the use of packages xtab or supertabular makes the table restricted to only one column.
Is there any way to insert the table in the mentioned two-column class, while the table comes as in a one-column document (the width of the table is much wider that can be placed in only one column of two). The problem is that: why the table is cut at the middle of the page. A typical code in \strip environment:
\documentclass[5p,times]{elsarticle}
\usepackage{cuted}
\usepackage{array}
\usepackage{booktabs}
\usepackage{caption}
\usepackage{xtab}
\usepackage{booktabs}
\usepackage{lipsum}
\begin{document}
\begin{frontmatter}
\title{Title}
\author{Name}
\begin{abstract}
The abstract.
\end{abstract}
\end{frontmatter}
\section{Introduction}
\lipsum[1-10]
\topcaption{This is the caption} \label{tab:xtab}
\tablefirsthead{\hline \multicolumn{1}{l}{\textbf{Command}} &
\multicolumn{1}{l}{Effect} \\ \hline }
\tablehead{\multicolumn{2}{l}%
{{\captionsize\bfseries \tablename\ \thetable{} --
continued from previous page}} \\
\hline \multicolumn{1}{l}{\textbf{Command}} &
\multicolumn{1}{l}{\textbf{Effect}} \\ \hline }
\tablelasthead{\multicolumn{2}{c}%
{{\captionsize\bfseries \tablename\ \thetable{} --
concluded from previous page}} \\
\hline \multicolumn{1}{l}{\textbf{Command}} &
\multicolumn{1}{l}{\textbf{Effect}} \\ \hline }
\tabletail{\hline \multicolumn{2}{r}{{Continued on next page}} \\ \hline}
\tablelasttail{\hline}
\begin{strip}
\begin{center}
\begin{xtabular}{p{0.4\textwidth}p{0.4\textwidth}}
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
content & some text\\
\end{xtabular}%
\end{center}
\end{strip}
\lipsum[1-10]
\end{document}
\stripenvironment, from thecutedpackage. Note that, as it's not a floating environment, you'll have to use\captionof. – Bernard Feb 10 '19 at 16:15\onecolumn\begin{longtable}.....\end{longtable}\twocolumn? – David Carlisle Feb 10 '19 at 18:52\onecolumn\begin{longtable}.....\end{longtable}\twocolumn, but the problem with it is that it makes a new page before and after the long table. – Alireza Feb 10 '19 at 18:56xtabpackage to insert the very long table in the strip environment. It works well except one problem: at the page, where the table begins, the table cannot go to the end of the page, I mean that if there is enough space, for example for the first ten rows, the table is cut after the fifth row, and the remained rows will insert to the next pages. – Alireza Feb 10 '19 at 18:57cutedand the environment\begin{strip} the table \end{strip}, where simultaneously used thextabpackage to insert the table inxtabularenvironment. Suppose that the table contains 200 rows, and suppose the table begins at the middle of the page 5. The first 3 rows, appear in this page (while below these three rows, there exist empty enough space to cover more rows), and the row 4 and the next rows go to the next pages. – Alireza Feb 10 '19 at 19:12xtabular? – Bernard Feb 10 '19 at 19:22xtabular. I just looking for an appropriate way to insert a long table in two-column class well, without occurring any bad appearance. – Alireza Feb 10 '19 at 20:26