latex table comes after next section code example

Example: move appendix to next page overleaf

\documentclass{article}

\usepackage{appendix}
\usepackage{etoolbox}

% Inserts \clearpage before \begin{appendices}
\BeforeBeginEnvironment{appendices}{\clearpage}
% Inserts \clearpage after \end{appendices}
%\AfterEndEnvironment{appendices}{\clearpage}

% Inserts \clearpage before every \section within appendices environment
%\AtBeginEnvironment{appendices}{\pretocmd{\section}{\clearpage}{}{}}{}

\begin{document}
    \section{Pre1}
    \section{Pre2}

    \begin{appendices}
        \section{App1}
        \section{App2}
    \end{appendices}

    \section{Post1}
    \section{Post2}
\end{document}

Tags:

Misc Example