1

I have the following long table and I want to split it into two pages.

\usepackage{graphicx}
\usepackage[utf8]{inputenc}
\usepackage{pdfpages}
\usepackage{booktabs}
\usepackage{lscape}
\usepackage{amsmath}
\usepackage{indentfirst}
\usepackage[normalem]{ulem}
\usepackage{soul}

\usepackage{subcaption}
\usepackage[section]{placeins}
\usepackage{float}
\usepackage{authblk}
\graphicspath{ {figures/} }
\usepackage{tabularx,ragged2e}
\newcolumntype{C}{>{\Centering\arraybackslash}X} 
\usepackage[utf8]{inputenc}
\usepackage{fourier} 
\usepackage{array}
\usepackage{makecell}
\renewcommand\theadalign{bc}
\renewcommand\theadfont{\bfseries}
\renewcommand\theadgape{\Gape[4pt]}
\renewcommand\cellgape{\Gape[4pt]}


\FloatBarrier
\begin{table}[!htbp]
{\renewcommand\arraystretch{1}
\setlength\extrarowheight{2pt} % for a bit of visual "breathing space"
\begin{tabularx}{\textwidth}{|C|C|C|C|C|C|}
\hline
\textbf{a} & \textbf{b} & \textbf{c} & \textbf{d} & \textbf{e} & \textbf{f} \\ \hline
000 & 000 & 000 & 000 & 000 & 000 \\ \hline
000 & 000 & 000 & 000 & 000 & 000 \\ \hline
000 & 000 & 000 & 000 & 000 & 000 \\ \hline
000 & 000 & 000 & 000 & 000 & 000 \\ \hline
000 & 000 & 000 & 000 & 000 & 000 \\ \hline
000 & 000 & 000 & 000 & 000 & 000 \\ \hline
000 & 000 & 000 & 000 & 000 & 000 \\ \hline
000 & 000 & 000 & 000 & 000 & 000 \\ \hline
000 & 000 & 000 & 000 & 000 & 000 \\ \hline
000 & 000 & 000 & 000 & 000 & 000 \\ \hline
\end{tabularx}}
\end{table}
1
  • 2
    Welcome to TeX.SE! Remove table float environment.It prevent split longtable between pages. However, so far you use simple tabularx which not enable to split table. See if packages ltablex or xltabular is what you looking for.
    – Zarko
    Commented Jun 26, 2019 at 6:16

1 Answer 1

1

With the help of the xltabular package:

enter image description here

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{ragged2e}
\usepackage{array}
\usepackage{xltabular}
\newcolumntype{C}{>{\Centering\arraybackslash}X} 

\usepackage{lipsum} % Only for dummy text. Remove in real document.

\begin{document}
\lipsum[1-3]\lipsum[1]

{\renewcommand\arraystretch{1}
\setlength\extrarowheight{2pt}
\begin{xltabular}{\textwidth}{|C|C|C|C|C|C|}
\hline
\textbf{a} & \textbf{b} & \textbf{c} & \textbf{d} & \textbf{e} & \textbf{f} \\ \hline
\endhead
000 & 000 & 000 & 000 & 000 & 000 \\ \hline
000 & 000 & 000 & 000 & 000 & 000 \\ \hline
000 & 000 & 000 & 000 & 000 & 000 \\ \hline
000 & 000 & 000 & 000 & 000 & 000 \\ \hline
000 & 000 & 000 & 000 & 000 & 000 \\ \hline
000 & 000 & 000 & 000 & 000 & 000 \\ \hline
000 & 000 & 000 & 000 & 000 & 000 \\ \hline
000 & 000 & 000 & 000 & 000 & 000 \\ \hline
000 & 000 & 000 & 000 & 000 & 000 \\ \hline
000 & 000 & 000 & 000 & 000 & 000 \\ \hline
\end{xltabular}}

\end{document}

You must log in to answer this question.

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