[Tex/LaTex] Vertically center a float in the remaining part of a page

floatsvertical alignment

How do I vertically center a table in the remaining part of a page? Specifically, I want to put a large table on a single page but I also want to have a subsection title line at the top. However, using the below code

\documentclass{article}
\usepackage{fontspec}
\setmainfont{TeX Gyre Termes}

\begin{document}
\subsection{Title}
\begin{figure}[p]\centering\begin{tabular}{c}
test\\
\end{tabular}\end{figure}
\end{document}

puts the table vertically centered, but on a new page.

Of course, others may want to have several paragraphs followed by a single float centered vertically in the remaining area of the page. So one wonders if there is a way to easily accomplish this?

Best Answer

A float environment is hardly warranted here, since you seem to require a specific location for your tabular environment. Why not just do the following?

See this for more details on what floats are used for.

enter image description here

\documentclass{article}

\usepackage{caption}
\usepackage{lipsum}

\begin{document}

\section{Foobar}

Please refer to Table~\ref{fig:mytable} for more details.

\lipsum[1]

\vspace*{\fill}
{
\centering
\begin{tabular}{c|c|c|c} 
  28 & 1 & (1)(28) & 28 \\
  27 & 0 & (0)(27) &  0 \\
  26 & 1 & (1)(26) & 26 \\
  25 & 2 & (2)(25) & 50 \\
  24 & 3 & (3)(24) & 72 \\
\end{tabular}
\captionof{table}{A magnificent table}
\label{fig:mytable}
}
\vspace*{\fill}
\clearpage

\end{document}