[Tex/LaTex] Sideways table takes new page

appendicesrotatingtables

I am writing a report and I want to place a big sidewaystable inside an appendix. More specifically, this appendix does not contain anything else but the table.

\newpage\begin{appendices}

\section{References}
%\addcontentsline{toc}{section}{References}

\bibliographystyle{IEEEtran}
\bibliography{bibliography}

\newpage
\section{Pitch - Frequency Table} \label{pitchfrequency}
\begin{sidewaystable}[htbp!]
\begin{tabular}{|l|c|c|c|c|c|c|c|c|c|c|c|c|}
  ...a lot of cell data...
\end{tabular}
\caption{Something.}
\end{sidewaystable}

\end{appendices}

I want the result to be one page for the appendix Pitch – Frequency Table, consisting of the appendix name and the table. However, the above code creates two pages, one for the appendix name and one for the sideways table. Any tips?

These are the two pages shown in Overleaf:

table

THIS CAN BE REPRODUCED HERE:
https://www.overleaf.com/9856935hhnzmbvssdhw

Best Answer

This will rotate the caption.

\documentclass{ieeetran}
\usepackage{graphicx}
\usepackage{caption}

\begin{document}
\begin{appendices}

\section{References}
%\addcontentsline{toc}{section}{References}

%\bibliographystyle{IEEEtran}
%\bibliography{bibliography}

\newpage
\section{Pitch - Frequency Table} \label{pitchfrequency}
\vfil
% get width of tabular
\sbox0{\begin{tabular}{|l|c|c|c|c|c|c|c|c|c|c|c|c|}
  ... & a & lot & of & cell & data & ...
\end{tabular}}
{\centering
\rotatebox[origin=c]{90}{\begin{minipage}{\wd0}
\usebox0
\captionof{table}{Something.}
\end{minipage}}%
}
\end{appendices}
\end{document}