0

Latex tables in ladscape or portarait format has been widly discussed here. I have almost tried all solutions presented here. However, I still face one issues. I have a table with more than 40 rows (40 is minimum) in it. I have two choices

1) to display whole table vertically on multiple pages or

2) make a landscape and move tables in parts horizontally along multiple pages.

I have tried all solutions such as minipage, longtable (it is suitable for single column articles not double), landscape,sidewaystables, rotatebox,'afterpage' etc. Here is one of the MWE that i have tried

\documentclass[10pt,a4paper,twocolumn]{article}
\usepackage{lipsum}
\usepackage{ltablex}
\begin{document}
\lipsum[1-2]
\begin{table}
 \rotatebox{90}{
\begin{minipage}{\textheight}
 %\begin{table}
 \centering
 \caption{Caption}
 \label{my-label}
 \begin{tabular}{p{4cm}p{3cm}p{3cm}lp{6cm}}
 \textbf{Author}   & \textbf{Type} & \textbf{Artifact} & \textbf{Method}   &   \textbf{Task}                                                                                                                                                            \\
Haiduc et al.     & Extractive               & C+M               &  IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\\\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\\\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\\\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\\\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\\\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\\\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\\\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\\\

Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\                                                
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\                                                
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\                                                
 Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\                                                
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\                                                
\end{tabular}
\end{minipage}}
\end{table}
\lipsum[3-7]
\end{document}

This is what i get enter image description here Tables with headers on everypage or on first page doesn't matter for me. Any suggestions??? and that also fits on double column articles??

1 Answer 1

1

There does not seem to be anything special about this table? Just longtable in a landscape environment seems to meet the requirements.

\documentclass[12pt,twocolumn]{article}
\usepackage{lipsum}
\usepackage{pdflscape,longtable,array}
\begin{document}
\lipsum[1-2]

 \onecolumn
 \begin{landscape}
 \begin{longtable}{p{4cm}p{3cm}p{3cm}lp{6cm}}
 \caption{Caption\label{my-label}}\\
 \textbf{Author}   & \textbf{Type} & \textbf{Artifact} & \textbf{Method}   &   \textbf{Task}                                                                                                                                                            \\
Haiduc et al.     & Extractive               & C+M               &  IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\\\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\\\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\\\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\\\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\\\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\\\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\\\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\\\

Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\                                                
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\                                                
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\                                                
 Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\                                                
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\
Haiduc et al.     & Extractive               & C+M               & IR              & Program Comprehension                                                                                                                                                    \\                                                
\end{longtable}
\end{landscape}
\twocolumn

\lipsum[3-7]
\end{document}
8
  • I have edited my question. Added a picture for better understanding. As I said I have tried all solutions but didn't get what is desireable. And i need a solution for double column article as well.
    – Skipper07
    Nov 10, 2015 at 9:15
  • @Skipper07 surely you don't want a table that wide in a single column of a 2-col page? Just put \onecolumn before the table Nov 10, 2015 at 10:59
  • @Skipper07 made it a 2-col example document Nov 10, 2015 at 11:03
  • I get following error when I use LongTable in my article. Longtable is used for one column articles, not two. This solution will work but not a precise one. `! Package longtable Error: longtable not in 1-column mode.'
    – Skipper07
    Nov 10, 2015 at 12:20
  • You can use \onecolumn as above to avoid that error, Nov 10, 2015 at 12:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .