由跨多页的独立表格组成的长表

由跨多页的独立表格组成的长表

我有一个由独立表格组成的多页表格。我想将长表格拆分为多个表格。

我使用过 longtable。这是正确的方法吗?无论如何,它无法与 colortbl 包正确交互。

在此处输入图片描述

而不是这个

在此处输入图片描述

知道如何解决这个问题吗?您将在下面找到 MWE

\documentclass{article}

\usepackage{longtable}
\usepackage{colortbl}
\definecolor{Lightgray}{gray}{.85}
    
\begin{document}
\begin{center}
\begin{longtable}{c}
\caption{A simple longtable example}\\
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|}\hline
\rowcolor[gray]{.8} \multicolumn{9}{|c|}{\bf Table 1} \\\hline
The & quick & brown & fox & jumps & over & the & lazy & dog \\
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\\hline
\end{tabular}
\\{ }\\
\begin{tabular}{ccc}
\begin{tabular}{|c|c|c|c|}\hline
\rowcolor[gray]{.8} \multicolumn{4}{|c|}{\bf Table 2} \\\hline
The & quick & brown & fox \\
1 & 2 & 3 & 4 \\ 
1 & 2 & 3 & 4 \\ 
1 & 2 & 3 & 4 \\ 
1 & 2 & 3 & 4 \\ 
1 & 2 & 3 & 4 \\ 
1 & 2 & 3 & 4 \\ 
1 & 2 & 3 & 4 \\ 
1 & 2 & 3 & 4 \\ 
1 & 2 & 3 & 4 \\ 
1 & 2 & 3 & 4 \\\hline
\end{tabular}
& { }\hspace{3mm}{ } &
\begin{tabular}{|c|c|c|c|c|}\hline
\rowcolor[gray]{.8} \multicolumn{5}{|c|}{\bf Table 3} \\\hline
jumps & over & the & lazy & dog \\
1 & 2 & 3 & 4 & 5 \\ 
1 & 2 & 3 & 4 & 5 \\ 
1 & 2 & 3 & 4 & 5 \\ 
1 & 2 & 3 & 4 & 5 \\ 
1 & 2 & 3 & 4 & 5 \\ 
1 & 2 & 3 & 4 & 5 \\ 
1 & 2 & 3 & 4 & 5 \\ 
1 & 2 & 3 & 4 & 5 \\ 
1 & 2 & 3 & 4 & 5 \\ 
1 & 2 & 3 & 4 & 5 \\\hline
\end{tabular}
\end{tabular}
\\
{ }
\\
\begin{tabular}{|c|c|c|c|}\hline
\rowcolor[gray]{.8} \multicolumn{4}{|c|}{\bf Table 4} \\\hline
The & quick & brown & fox \\
1 & 2 & 3 & 4 \\ 
1 & 2 & 3 & 4 \\ 
1 & 2 & 3 & 4 \\ 
1 & 2 & 3 & 4 \\ 
1 & 2 & 3 & 4 \\ 
1 & 2 & 3 & 4 \\ 
1 & 2 & 3 & 4 \\ 
1 & 2 & 3 & 4 \\ 
1 & 2 & 3 & 4 \\ 
1 & 2 & 3 & 4 \\ 
1 & 2 & 3 & 4 \\ 
1 & 2 & 3 & 4 \\\hline
\end{tabular}
\\
{ }
\\
\begin{tabular}{|c|c|c|c|c|c|}\hline
\rowcolor[gray]{.8} \multicolumn{6}{|c|}{\bf Table 5} \\\hline
The & quick & brown & fox & jumps & over \\
1 & 2 & 3 & 4 & 5 & 6 \\ 
1 & 2 & 3 & 4 & 5 & 6 \\ 
1 & 2 & 3 & 4 & 5 & 6 \\ 
1 & 2 & 3 & 4 & 5 & 6 \\ 
1 & 2 & 3 & 4 & 5 & 6 \\ 
1 & 2 & 3 & 4 & 5 & 6 \\ 
1 & 2 & 3 & 4 & 5 & 6 \\ 
1 & 2 & 3 & 4 & 5 & 6 \\ 
1 & 2 & 3 & 4 & 5 & 6 \\ 
1 & 2 & 3 & 4 & 5 & 6 \\ 
1 & 2 & 3 & 4 & 5 & 6 \\ 
1 & 2 & 3 & 4 & 5 & 6 \\\hline
\end{tabular}
\\{}\\
\begin{tabular}{|c|c|c|c|c|}\hline
\rowcolor[gray]{.8} \multicolumn{5}{|c|}{\bf Table 6} \\\hline
The & quick & brown & fox & jumps \\
1 & 2 & 3 & 4 & 5 \\
1 & 2 & 3 & 4 & 5 \\ 
1 & 2 & 3 & 4 & 5 \\ 
1 & 2 & 3 & 4 & 5 \\ 
1 & 2 & 3 & 4 & 5 \\ 
1 & 2 & 3 & 4 & 5 \\ 
1 & 2 & 3 & 4 & 5 \\ 
1 & 2 & 3 & 4 & 5 \\ 
1 & 2 & 3 & 4 & 5 \\ 
1 & 2 & 3 & 4 & 5 \\ 
1 & 2 & 3 & 4 & 5 \\
1 & 2 & 3 & 4 & 5 \\\hline
\end{tabular}
\end{longtable}
\end{center}

\begin{center}
\begin{table}
\caption{A simple longtable example}
\centering
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|}\hline
\rowcolor[gray]{.8} \multicolumn{9}{|c|}{\bf Table 1} \\\hline
The & quick & brown & fox & jumps & over & the & lazy & dog \\
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\\hline
\end{tabular}
\\[3mm]
\begin{tabular}{|c|c|c|c|}\hline
\rowcolor[gray]{.8} \multicolumn{4}{|c|}{\bf Table 2} \\\hline
The & quick & brown & fox \\
1 & 2 & 3 & 4 \\ 
1 & 2 & 3 & 4 \\ 
1 & 2 & 3 & 4 \\ 
1 & 2 & 3 & 4 \\ 
1 & 2 & 3 & 4 \\ 
1 & 2 & 3 & 4 \\ 
1 & 2 & 3 & 4 \\ 
1 & 2 & 3 & 4 \\ 
1 & 2 & 3 & 4 \\ 
1 & 2 & 3 & 4 \\\hline
\end{tabular}
\hspace{3mm}
\begin{tabular}{|c|c|c|c|c|}\hline
\rowcolor[gray]{.8} \multicolumn{5}{|c|}{\bf Table 3} \\\hline
jumps & over & the & lazy & dog \\
1 & 2 & 3 & 4 & 5 \\ 
1 & 2 & 3 & 4 & 5 \\ 
1 & 2 & 3 & 4 & 5 \\ 
1 & 2 & 3 & 4 & 5 \\ 
1 & 2 & 3 & 4 & 5 \\ 
1 & 2 & 3 & 4 & 5 \\ 
1 & 2 & 3 & 4 & 5 \\ 
1 & 2 & 3 & 4 & 5 \\ 
1 & 2 & 3 & 4 & 5 \\ 
1 & 2 & 3 & 4 & 5 \\\hline
\end{tabular}
\\[3mm]
\begin{tabular}{|c|c|c|c|}\hline
\rowcolor[gray]{.8} \multicolumn{4}{|c|}{\bf Table 4} \\\hline
The & quick & brown & fox \\
1 & 2 & 3 & 4 \\ 
1 & 2 & 3 & 4 \\ 
1 & 2 & 3 & 4 \\ 
1 & 2 & 3 & 4 \\ 
1 & 2 & 3 & 4 \\ 
1 & 2 & 3 & 4 \\ 
1 & 2 & 3 & 4 \\ 
1 & 2 & 3 & 4 \\ 
1 & 2 & 3 & 4 \\ 
1 & 2 & 3 & 4 \\ 
1 & 2 & 3 & 4 \\ 
1 & 2 & 3 & 4 \\\hline
\end{tabular}
\\[3mm]
\begin{tabular}{|c|c|c|c|c|c|}\hline
\rowcolor[gray]{.8} \multicolumn{6}{|c|}{\bf Table 5} \\\hline
The & quick & brown & fox & jumps & over \\
1 & 2 & 3 & 4 & 5 & 6 \\ 
1 & 2 & 3 & 4 & 5 & 6 \\ 
1 & 2 & 3 & 4 & 5 & 6 \\ 
1 & 2 & 3 & 4 & 5 & 6 \\ 
1 & 2 & 3 & 4 & 5 & 6 \\ 
1 & 2 & 3 & 4 & 5 & 6 \\ 
1 & 2 & 3 & 4 & 5 & 6 \\ 
1 & 2 & 3 & 4 & 5 & 6 \\ 
1 & 2 & 3 & 4 & 5 & 6 \\ 
1 & 2 & 3 & 4 & 5 & 6 \\ 
1 & 2 & 3 & 4 & 5 & 6 \\ 
1 & 2 & 3 & 4 & 5 & 6 \\\hline
\end{tabular}
\\[3mm]
\begin{tabular}{|c|c|c|c|c|}\hline
\rowcolor[gray]{.8} \multicolumn{5}{|c|}{\bf Table 6} \\\hline
The & quick & brown & fox & jumps \\
1 & 2 & 3 & 4 & 5 \\
1 & 2 & 3 & 4 & 5 \\ 
1 & 2 & 3 & 4 & 5 \\ 
1 & 2 & 3 & 4 & 5 \\ 
1 & 2 & 3 & 4 & 5 \\ 
1 & 2 & 3 & 4 & 5 \\ 
1 & 2 & 3 & 4 & 5 \\ 
1 & 2 & 3 & 4 & 5 \\ 
1 & 2 & 3 & 4 & 5 \\ 
1 & 2 & 3 & 4 & 5 \\ 
1 & 2 & 3 & 4 & 5 \\
1 & 2 & 3 & 4 & 5 \\\hline
\end{tabular}
\end{table}
\end{center}
\end{document}

相关内容