I would like to create a multi-page table in landscape format. To create the multi-page table I'm currenly using the ltablex package, i.e. the
tabularx
environment, embedded in a sidewaystable
environment. At the moment this combination seem to ignore page breaks and thus my table is overfloating set page boundaries.The documentation on ltablex is rather slim and I was wondering if someone might know if the ltablex and rotating packages are overwriting or excluding each other, as the table breaks without problems over several pages when not included in the
sidewaystable
environment.If this should be the case, do you have possible suggestions of how to get around this problem as the size of the table requires it to be in landscape format.
I searched quite a bit online and am aware of the tabu package. Unfortunately I was unable to install it. If this should be the only recommended solution I will open another thread for my tabu installation problem. I, however, hope that there is a solution to be found using ltablex.
Many thanks,
Astrid
Code: Select all
\documentclass[a4paper, 12pt]{report}
\usepackage{tabularx}
\usepackage{ltablex}
\usepackage{booktabs}
\usepackage{graphicx}
\usepackage{rotating}
\usepackage{array}
\usepackage{multirow}
\usepackage{longtable}
\begin{document}
\begin{sidewaystable}[htb]
\begin{tabularx}{\textwidth}{X p{0.8cm}p{0.8cm}p{0.8cm}p{0.8cm}p{1.6cm}p{1.6cm}p{1.6cm}p{0.8cm}p{0.8cm}p{0.8cm}p{0.8cm}}
\caption{This should become a very long multi-page table.}\\
\toprule
& \multicolumn{11}{l}{Something}\\
& \multicolumn{5}{l}{\textit{xxxxx}} & \multicolumn{6}{l}{\textit{xxxxx}}\\ \cmidrule(r){2-6} \cmidrule(r){7-12}
& \multicolumn{11}{l}{Something}\\
&\multicolumn{5}{l}{\textit{xxxxx}} & \multicolumn{6}{l}{\textit{xxxxxx}}\\ \cmidrule(r){2-6} \cmidrule(r){7-12}
\multirow{2}{*}{Taxa} & \multicolumn{2}{l}{X} & \multicolumn{2}{l}{X} & X & X & X & \multicolumn{2}{l}{X} & \multicolumn{2}{l}{X}\\
\cmidrule(r){2-3} \cmidrule(r){4-5} \cmidrule(r){6-6} \cmidrule(r){7-7} \cmidrule(r){8-8} \cmidrule(r){9-10} \cmidrule(r){11-12}
& 1 & 2 &1 & 2 & & & &1 &2 &1 &2 \\
\toprule
\endfirsthead
\caption{some sort of caption. (continued)}\\
\toprule
& \multicolumn{11}{l}{Something}\\
& \multicolumn{5}{l}{\textit{xxxxx}} & \multicolumn{6}{l}{\textit{xxxxx}}\\ \cmidrule(r){2-6} \cmidrule(r){7-12}
& \multicolumn{11}{l}{Something}\\
&\multicolumn{5}{l}{\textit{xxxxx}} & \multicolumn{6}{l}{\textit{xxxxxx}}\\ \cmidrule(r){2-6} \cmidrule(r){7-12}
\multirow{2}{*}{Taxa} & \multicolumn{2}{l}{X} & \multicolumn{2}{l}{X} & X & X & X & \multicolumn{2}{l}{X} & \multicolumn{2}{l}{X}\\
\cmidrule(r){2-3} \cmidrule(r){4-5} \cmidrule(r){6-6} \cmidrule(r){7-7} \cmidrule(r){8-8} \cmidrule(r){9-10} \cmidrule(r){11-12}
& 1 & 2 &1 & 2 & & & &1 &2 &1 &2 \\
\toprule
\endhead
\bottomrule
\multicolumn{2}{l}{{Continued on Next Page\ldots}} \\
\bottomrule
\endfoot
\bottomrule
\endlastfoot
\textit{A very long species name} &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 \\
\textit{A very long species name} &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 \\
\textit{A very long species name} &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 \\ \cmidrule(r){1-1}
\textit{A very long species name} &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 \\
\textit{A very long species name} &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 \\
\textit{A very long species name} &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 \\
\textit{A very long species name} &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 \\
\textit{A very long species name} &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 \\
\textit{A very long species name} &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 \\
\textit{A very long species name} &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 \\
\textit{A very long species name} &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 \\
\textit{A very long species name} &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 \\
\textit{A very long species name} &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 \\
\textit{A very long species name} &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 \\
\textit{A very long species name} &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 \\ \cmidrule(r){1-1}
\textit{A very long species name} &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 \\
\textit{A very long species name} &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 \\
\textit{A very long species name} &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 \\
\textit{A very long species name} &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 \\
\textit{A very long species name} &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 \\
\textit{A very long species name} &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 \\
\textit{A very long species name} &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 \\
\textit{A very long species name} &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 \\
\textit{A very long species name} &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 \\
\textit{A very long species name} &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 \\
\textit{A very long species name} &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 \\
\textit{A very long species name} &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 \\ \cmidrule(r){1-1}
\textit{A very long species name} &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 \\
\end{tabularx}
\end{sidewaystable}