4

I have to create a table with several columns. I couldn't create it as a single table because number of columns will not fit into a single page. So I split the table by showing some columns first and the rest later.

enter image description here

Here you can see the same table named differently, according to the split (table 3 and 4). Is there a way to give the same table name for the each split (only as table 3)?

Here is my code:

\begin{table}[p]
  \caption{Summary results}
  
  \begin{center}
  \begin{tabular}{lllllllllllcp{2.5in}} \hline
    & \multicolumn{5}{c}{\textbf{t 1}} &
    \multicolumn{5}{c}{\textbf{t 2}}    \\ 
    & \textbf{Overall} & \textbf{a} &
   \textbf{a}& \textbf{b} &
   \textbf{b}& \textbf{Overall} & \textbf{a} &
  \textbf{a} & \textbf{b} &
   \textbf{b} \\\hline
   \textbf{Predictor} &  & \textbf{1} &
   \textbf{0} & \textbf{1} &
   \textbf{0}& \textbf{Overall} & \textbf{1} &
   \textbf{0} & \textbf{1} &
   \textbf{0} \\\hline
  A scale & 0.14 &  0.16 &  0.14 &  & & 0.14 &  0.16 &  0.14  \\
    
 D  scale  &    0.22    & 0.28  &   0.27  & &  &    0.25 &  0.28 &  0.27\\
 



   \end{tabular}
  \end{center}
\end{table}


\begin{table}[p]
  \caption{Summary results.}
  
  \begin{center}
  \begin{tabular}{lllllllllllcp{2.5in}} \hline
    & \multicolumn{5}{c}{\textbf{t 3}} &
    \multicolumn{5}{c}{\textbf{t 4}}    \\ 
    & \textbf{Overall} & \textbf{a} &
   \textbf{a}& \textbf{b} &
   \textbf{b}& \textbf{Overall} & \textbf{a} &
  \textbf{a} & \textbf{b} &
   \textbf{b} \\\hline
   \textbf{Predictor} &  & \textbf{1} &
   \textbf{0} & \textbf{1} &
   \textbf{0}& \textbf{Overall} & \textbf{1} &
   \textbf{0} & \textbf{1} &
   \textbf{0} \\\hline
  A scale & 0.14 &  0.16 &  0.14 &  & & 0.14 &  0.16 &  0.14  \\
    
 D  scale  &    0.22    & 0.28  &   0.27  & &  &    0.25 &  0.28 &  0.27\\
 



   \end{tabular}
  \end{center}
\end{table}

Thank you in advance!!

5
  • Just use a single table environment containing two tabulars.
    – Bernard
    Commented Jun 25, 2022 at 21:42
  • Off-topic: Do use \centering directives, not \begin{center} ... \end{center} in figure and table floats.
    – Mico
    Commented Jun 25, 2022 at 21:47
  • @Bernard - I think (though I may be wrong...) that the OP's issue is that the two tabular envrionments are too large to fit on a single page. Hence, encasing them both in a single table directive may not be the way to go.
    – Mico
    Commented Jun 25, 2022 at 21:48
  • Incidentally, have you considered using a single longtable environment instead of two tabular/table combinations?
    – Mico
    Commented Jun 25, 2022 at 21:53
  • 1
    @Mico: I thought of this solutions, but as the O.P. seemed, as I understood it, to want have two tabulars separated by some vertical space, the solution of two vertically aligned tabulars was more natural, from my point of view.
    – Bernard
    Commented Jun 25, 2022 at 21:57

1 Answer 1

5

You may achieve your formatting objective by loading the caption package and issuing a \ContinuedFloat directive after starting the second table environment (and before issuing the associated \caption directive, of course). As the following example demonstrates, the arguments of the \caption directives needn't be identical.

enter image description here

\documentclass{article}
\usepackage{caption} % for \ContinuedFloat macro
\captionsetup{skip=0.333\baselineskip} % optional

\begin{document}
\setcounter{table}{2} % just for this example

\begin{table}[htbp]
\centering
  \caption{Summary results}
  \begin{tabular}{lllllllllllc p{2.5in}} 
  \hline
    & \multicolumn{5}{c}{\textbf{t 1}} 
    & \multicolumn{5}{c}{\textbf{t 2}} \\ 
    & \textbf{Overall} & \textbf{a} &
   \textbf{a}& \textbf{b} &
   \textbf{b}& \textbf{Overall} & \textbf{a} &
   \textbf{a}& \textbf{b} &
   \textbf{b} \\
   \hline
   \textbf{Predictor} &  & \textbf{1} &
   \textbf{0}& \textbf{1} &
   \textbf{0}& \textbf{Overall} & \textbf{1} &
   \textbf{0}& \textbf{1} &
   \textbf{0} \\
   \hline
   A scale & 0.14 & 0.16 & 0.14 & & & 0.14 & 0.16 & 0.14 \\    
   D scale & 0.22 & 0.28 & 0.27 & & & 0.25 & 0.28 & 0.27 \\
   \end{tabular}
\end{table}

\begin{table}[htbp]
\ContinuedFloat
\centering
  \caption{Summary results, continued}
  \begin{tabular}{lllllllllllc p{2.5in}} 
  \hline
    & \multicolumn{5}{c}{\textbf{t 3}} 
    & \multicolumn{5}{c}{\textbf{t 4}}    \\ 
    & \textbf{Overall} & \textbf{a} &
   \textbf{a}& \textbf{b} &
   \textbf{b}& \textbf{Overall} & \textbf{a} &
   \textbf{a}& \textbf{b} &
   \textbf{b} \\
   \hline
   \textbf{Predictor} &  & \textbf{1} &
   \textbf{0}& \textbf{1} &
   \textbf{0}& \textbf{Overall} & \textbf{1} &
   \textbf{0}& \textbf{1} &
   \textbf{0} \\
   \hline
   A scale & 0.14 & 0.16 & 0.14 & & & 0.14 & 0.16 & 0.14 \\
   D scale & 0.22 & 0.28 & 0.27 & & & 0.25 & 0.28 & 0.27 \\
   \end{tabular}
\end{table}
\end{document}
2
  • Hi. Thank you very much for the answer. I have a quick question. Will this method separate two tables in to two pages, if there are if there are several rows ?(so that both tables will not fit into a single page) Commented Jun 25, 2022 at 21:48
  • 2
    @student_R123 - Indeed, if the contents of the table environments are too large to fit on the same page, they'll be placed on separate pages. Incidentally, this is true of all table environments, not just those that contain \ContinuedFloat directives.
    – Mico
    Commented Jun 25, 2022 at 21:50

You must log in to answer this question.

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