# Grouping two tables, one above the other

I'd like to group two tables, one below the other, so they don't show separated ie. one in each page. What's the best way to achieve that? I've read about positioning them side by side, but not this.

Probably, I could create a custom float with \usepackage{float}, but I bet there is a simpler way (other than playing around with [htpb]).

• Welcome to TeX.SX! Any number of tables, with their captions, can go in the same table environment (so long as they fit in a page). May 23, 2014 at 17:34
• But then they will show up in the Index of tables as the same table. I want them to be separate tables, yet be grouped. May 23, 2014 at 17:34
• It's the caption that produces the entry in the list of tables. Two captions, two entries. May 23, 2014 at 17:35
• Thank you. I was making a really wrong assumption there. May 23, 2014 at 17:37
• @Arnaugir Every caption should have its own label. May 23, 2014 at 17:45

Any number of tables can go in a single table environment, along with their captions, so long as they fit in a page.

The entries in the list of tables are generated by the \caption command, so there will be two entries even if two tables are in the same table environment.

However, there will be a problem when the caption package is loaded together with hyperref, because the link in the list of tables or the ones made by \ref might bring to the first of the two tables. The hypcap package fixes it.

Here's an example.

\documentclass{article}
\usepackage{kantlipsum} % just to produce nonsense text

\usepackage{caption} % for better vertical separation
\usepackage{hyperref}

\begin{document}
\title{A title}
\author{A. Uthor}

\maketitle

\listoftables

\section{A section}

A reference to the first table~\ref{tab:first} and one to the
second table~\ref{tab:second}, followed by nonsense text.

\kant

\begin{table}[htp]

\centering
\caption{First table}\label{tab:first}

\begin{tabular}{ll}
\hline
ab & cd \\
ab & cd \\
ab & cd \\
\hline
\end{tabular}

\bigskip

\caption{Second table}\label{tab:second}

\begin{tabular}{ll}
\hline
ab & cd \\
ab & cd \\
ab & cd \\
\hline
\end{tabular}

\end{table}

\kant

\end{document}


I think you have a couple of options here:

Make the tables smaller by simply using \small or \footnotesize in your table. E.g.:

\begin{table}\footnotesize
\caption{Table caption A}\label{tab:A}
\begin{tabular}{ll}
One & two\\
\end{tabular
\end{table}


Other option is setting one to be on top of the page and another one on the bottom:

\begin{table}[t!]
\caption{Table caption A}\label{tab:A}
\begin{tabular}{ll}
One & two\\
\end{tabular
\end{table}

\begin{table}[b!]
\caption{Table caption B}\label{tab:B}
\begin{tabular}{ll}
One & two\\
\end{tabular
\end{table}

• Second option!! Jan 23, 2020 at 10:13