1

I have a certain document with a few tables one after another. Each table is in its own subsubsection. The peculiar thing about these tables is that two tables can fit on a page with a subsubsection title, but only one can fit with the section, subsection and subsubsection. With just one table:

\documentclass{book}
\usepackage{graphicx}
\usepackage{float}
\usepackage{array}

\begin{document}
\section{Section}
\subsection{Subsection}

\subsubsection*{Table 1}
\begin{table}[H]
\centering
\scalebox{0.65}{
\begin{tabular}{|m{1cm}|m{1cm}|m{1cm}|m{1cm}|m{1cm}|m{1cm}|m{1cm}|m{1cm}|m{1cm}|m{1cm}|m{1cm}|}
    \hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
\end{tabular}
}
\caption{Table 1 Caption}
\end{table}


\end{document}

I get a perfectly fine output:

just one table

However, as soon as I have multiple tables:

\documentclass{book}
\usepackage{graphicx}
\usepackage{float}
\usepackage{array}

\begin{document}
\section{Section}
\subsection{Subsection}

\subsubsection*{Table 1}
\begin{table}[H]
\centering
\scalebox{0.65}{
\begin{tabular}{|m{1cm}|m{1cm}|m{1cm}|m{1cm}|m{1cm}|m{1cm}|m{1cm}|m{1cm}|m{1cm}|m{1cm}|m{1cm}|}
    \hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
\end{tabular}
}
\caption{Table 1 Caption}
\end{table}

\subsubsection*{Table 2}
\begin{table}[H]
\centering
\scalebox{0.65}{
\begin{tabular}{|m{1cm}|m{1cm}|m{1cm}|m{1cm}|m{1cm}|m{1cm}|m{1cm}|m{1cm}|m{1cm}|m{1cm}|m{1cm}|}
    \hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
\end{tabular}
}
\caption{Table 2 Caption}
\end{table}

\subsubsection*{Table 3}
\begin{table}[H]
\centering
\scalebox{0.65}{
\begin{tabular}{|m{1cm}|m{1cm}|m{1cm}|m{1cm}|m{1cm}|m{1cm}|m{1cm}|m{1cm}|m{1cm}|m{1cm}|m{1cm}|}
    \hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
 & & & & & & & & & & \\\hline
\end{tabular}
}
\caption{Table 3 Caption}
\end{table}

\end{document}

The pages look like this:

three tables page one three tables page two

I want the first page to stay exactly the same way as it was before. I found one solution, i.e. adding a '\clearpage' just after the first '\end{table}', which gives me:

three tables with clearpage page one three tables with clearpage page two

However, this solution is not elegant enough for me, since it involves doing something specifically for the first table, whereas the tables are, in all other ways, equivalent.

Is there a solution which automatically adjusts(forces) the tables to stay on top of the page and not 'gravitate' towards its following tables?

I already tried \vfill{} and \vspace{\fill} with no success!

lockstep
  • 250,273
user34812
  • 325

0 Answers0