I have 4 tables that need to follow each other (they are in the appendix). Two fit on a single page together but there is plenty of space left (thought not enough for another table). I would like to vertically center these two tables so that they don't look weird. How can I do that?
Here is my code (I want the tables to vertically centered):
\documentclass[11pt,a4paper]{article}
\usepackage{float} % For H
\begin{document}
\begin{table}[H]
\centering
\begin{tabular}{|c|c|}
\hline
8 & 4 \\ \hline 4 & 8 \\ \hline
4 & 8 \\ \hline 8 & 4 \\ \hline
8 & 8 \\ \hline 8 & 4 \\ \hline
4 & 8 \\ \hline 4 & 8 \\ \hline
8 & 4 \\ \hline 8 & 8 \\ \hline
8 & 4 \\ \hline 4 & 8 \\ \hline
4 & 8 \\ \hline 8 & 4 \\ \hline
\end{tabular}
\caption{Order = 1}
\end{table}
\begin{table}[H]
\centering
\begin{tabular}{|c|c|}
\hline
8 & 4 \\ \hline 4 & 8 \\ \hline
4 & 8 \\ \hline 8 & 4 \\ \hline
8 & 8 \\ \hline 8 & 4 \\ \hline
4 & 8 \\ \hline 4 & 8 \\ \hline
8 & 4 \\ \hline 8 & 8 \\ \hline
8 & 4 \\ \hline 4 & 8 \\ \hline
4 & 8 \\ \hline 8 & 4 \\ \hline
\end{tabular}
\caption{Order = 2}
\end{table}
\begin{table}[H]
\centering
\begin{tabular}{|c|c|}
\hline
8 & 4 \\ \hline 4 & 8 \\ \hline
4 & 8 \\ \hline 8 & 4 \\ \hline
8 & 8 \\ \hline 8 & 4 \\ \hline
4 & 8 \\ \hline 4 & 8 \\ \hline
8 & 4 \\ \hline 8 & 8 \\ \hline
8 & 4 \\ \hline 4 & 8 \\ \hline
4 & 8 \\ \hline 8 & 4 \\ \hline
\end{tabular}
\caption{Order = 3}
\end{table}
\begin{table}[H]
\centering
\begin{tabular}{|c|c|}
\hline
8 & 4 \\ \hline 4 & 8 \\ \hline
4 & 8 \\ \hline 8 & 4 \\ \hline
8 & 8 \\ \hline 8 & 4 \\ \hline
4 & 8 \\ \hline 4 & 8 \\ \hline
8 & 4 \\ \hline 8 & 8 \\ \hline
8 & 4 \\ \hline 4 & 8 \\ \hline
4 & 8 \\ \hline 8 & 4 \\ \hline
\end{tabular}
\caption{Order = 4}
\end{table}
\end{document}
Best Answer
It's best not to use the
[H]
float placement here. Rather use a[p]
age of floats setting. Additionally, if need be, you could use theafterpage
package to flush any pending floats:While it may not be apparent in the image above, the floats were placed somewhere mid-page on the page preceding the placement. Also not that, for the sake of "keeping things together", the two figures were placed in a single float. That's fine, since the
\caption
for each separates them visually from the output, as well as the space between (which you can adjust).The above approach also works with
table
s.For a general discussion on float placement, see the FAQ How to influence the position of float environments like figure and table in LaTeX?.