Two tabulars in one Table but in different pages

1,155

A proposition: Store one tabular (PanelA) in a savebox, call it inside a longtable environment and then introduce a \newpage for the next page, use a \phantom{\usebox{....}} (see code) and then continue with the second panel tabular.

As long as there is no precise information, what fills the place on the second page, I took the spacing produced by PanelA.

\documentclass[paper=a4,12pt]{scrartcl}

\usepackage{longtable}%

\begin{document}

\newsavebox{\PanelABox}

\savebox{\PanelABox}{\begin{tabular}{l}
\textbf{Panel A} \tabularnewline
\tabularnewline
\tabularnewline
\tabularnewline
\tabularnewline
\tabularnewline
\tabularnewline
\tabularnewline
\end{tabular}%
}%

\begin{longtable}{c}%
\hline
\tabularnewline
\usebox{\PanelABox} \tabularnewline
\hline
\newpage
\hline
\tabularnewline
\phantom{\usebox{\PanelABox}} \tabularnewline
\hline
\begin{tabular}{l}
\textbf{Panel B}
\end{tabular}%

\end{longtable}


\end{document}

enter image description here

Edit After update of the OP's precise request

\documentclass[paper=a4,12pt]{scrartcl}

\usepackage{longtable}%



\begin{document}

\newsavebox{\PanelABox}

\savebox{\PanelABox}{\begin{tabular}{|l|}
\hline
\textbf{Panel A} \tabularnewline
\tabularnewline
\tabularnewline
\tabularnewline
\tabularnewline
\tabularnewline
\tabularnewline
\tabularnewline
\hline
\end{tabular}
}%



\begin{longtable}{|c|}%
\hline
\tabularnewline
\usebox{\PanelABox} \tabularnewline
\hline
\newpage
\hline
\tabularnewline
\begin{tabular}{|l|}
\hline
\textbf{Panel B} \tabularnewline
\tabularnewline
\tabularnewline
\tabularnewline
\tabularnewline
\tabularnewline
\tabularnewline
\tabularnewline
\hline
\end{tabular} \tabularnewline
\hline
\end{longtable}

\end{document}

enter image description here

Share:
1,155

Related videos on Youtube

Thanos Sak
Author by

Thanos Sak

Updated on August 06, 2020

Comments

  • Thanos Sak
    Thanos Sak over 3 years

    enter image description hereI would like to ask you how could I have in one table two parts (tabulars) BUT in different pages? I tried bigskip or pagebreak but it does't work

    Thank you in advance

    • Admin
      Admin over 9 years
      Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. Especially a screen shot or a sketch would help
    • Admin
      Admin over 9 years
      Have you considered to use a longtable and placing the two tabular environments inside? Should the two parts be side-by-side or stacked?
    • Thanos Sak
      Thanos Sak over 9 years
      Thank you very much Christian. I appreciate your help. I am newy in LATEX tables. I want the two parts(panels) of the table to be stacked but in different pages. For example in page 1 would be {{Panel A...} and in page 2 would be {Panel B...} of the SAME Table. I used longtable but unfortunately it doesn't work.
    • Admin
      Admin over 9 years
      What is the filler on the second page, above Panel B?
    • Johannes_B
      Johannes_B over 9 years
      You don't have to use longtable. If yu have your tabulars, put them in minipages each and set a caption with \captionof{table}{Your caption}. But i hvae a little trouble imagining the desired output. An MWE (as already requested by @ChristianHupfer Hupfer) might help.
    • Admin
      Admin over 9 years
      @Johannes_B: The proposition with longtable was before the precise configuration was known.
    • Bernard
      Bernard over 9 years
      Do you mean you have two actually different table, but you want only one caption for the whole set (sort of ‘logical table’)?
    • Admin
      Admin over 9 years
      @ThanosSak: Those two tables in your screenshot are not stacked really, they are side-by-side, on verso-recto pages however
    • Thanos Sak
      Thanos Sak over 9 years
      Christian they are at different pages. Sorry,yes you are right they are not stacked. What you mean by side-by-side?
    • Admin
      Admin over 9 years
      @ThanosSak: Both panels seem to be of equal size, having the same distance to the topmargin of their pages, so I would say, they are side-by-side, however, on two pages
    • Thanos Sak
      Thanos Sak over 9 years
      Yes. Exactly Christian.
    • Admin
      Admin over 9 years
      @ThanosSak: In your comment about 1 hour ago you wrote that they are stacked ;-)
    • Thanos Sak
      Thanos Sak over 9 years
      @Christian. Yes, you are right. Sorry for that. What I want is to have two Panels (I do not care if they have the same size) in two pages that belong in one table.Thank you again.
    • Admin
      Admin over 9 years
      @ThanosSak: I updated my solution -- they are in one table, spanning two pages, the \savebox is not really necessary, but I kept it.
  • Johannes_B
    Johannes_B over 9 years
    Why so complicated?
  • Johannes_B
    Johannes_B over 9 years
    @thanos Do you care if the tables are visible on the same open page couple (panel A left and panel B right)?
  • Admin
    Admin over 9 years
    @Johannes_B: I considered your objection also, I believe, that both panels should be on the verso-recto combination, not vice versa, but I do not have added some code to guarantee this ...