2

I have a table environment with different tabular environments and I am wondering how to enforce a page break. longtable does not work as the number of columns is different for the different tabulars, \pagebreak is also of no help.

So, how can I create tables with several panels which span over several pages?

\begin{table}
    \centering
    \caption{An interesting table}
    \subcaption*{Panel A: Some stuff}
    \begin{tabular}{lcr}
        First name & Last name  & Product \\
        Bubba & Gump & Shrimp \\
        Steve & Jobs & Happiness
    \end{tabular}
   \pagebreak
    \bigskip
    \subcaption*{Panel B: Other stuff}
    \begin{tabular}{ll}
        School & State \\
        Harvard & MA \\
        Yale & CT \\
        Brown & RI
    \end{tabular}
\end{table}

Edit (based on comment of @koleygr) The page break works using

\documentclass{article}
\usepackage{caption}
\usepackage{longtable}
\usepackage{subcaption}
\usepackage{tabularx}
\usepackage{caption}

\begin{document}

\centering
\captionof{table}{My caption}
\begin{tabular}{lcr}
First name & Last name  & Product \\
Bubba & Gump & Shrimp \\
Steve & Jobs & Happiness
\end{tabular}
\bigskip
\pagebreak
\captionof{table}{My caption}
\begin{tabular}{ll}
School & State \\
Harvard & MA \\
Yale & CT \\
Brown & RI
\end{tabular}

\end{document}

However, this creates inconsistent caption numberings.

3
  • the only problem is that you use table environment that is a float for one page. If you just remove that and use \captionof{table}{My caption} from caption package, I think you can do your job.
    – koleygr
    Oct 9, 2017 at 13:01
  • Thanks @koleygr! But how can I ensure that the numbering reflects that this is still one Table? (So in the caption it is now saying Table 1: ... and Table2:...? Oct 9, 2017 at 13:07
  • Are you aware that you're stretching typographic conventions to the breaking point (and maybe even a bit further) by insisting on calling a collection of tabular environments that span several pages a single table? What exactly are you trying to achieve? Are you confident your readers will "get" what you're doing? Or is there a risk that they'll be highly confused?
    – Mico
    Oct 9, 2017 at 13:30

1 Answer 1

0

Try like this:

\documentclass{article}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{lipsum}
\begin{document}
\lipsum[1-4]

{\begin{center}
\captionof{table}{My caption}
    \captionof{subtable}{Panel A: Some stuff}
    \begin{tabular}{lcr}
        First name & Last name  & Product \\
        Bubba & Gump & Shrimp \\
        Steve & Jobs & Happiness
    \end{tabular}
    \pagebreak

    \captionof{subtable}{Panel B: Other stuff}

    \begin{tabular}{ll}
        School & State \\
        Harvard & MA \\
        Yale & CT \\
        Brown & RI
    \end{tabular}
    \end{center}}
\end{document}
1
  • may be the command `\captionsetup[subtable]{labelsep=space,labelformat = parens}' will be usefull for you
    – koleygr
    Oct 9, 2017 at 13:29

You must log in to answer this question.

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