[Tex/LaTex] Page breaking up for caption of a table

captionspage-breakingtables

Using the following I get problem by page break up.

\IfFileExists{FILE}{%
\begin{center}
\captionof{table}{Grenzwertverletzung [AL9]}
\begin{tabular}{ll}
 AL9&  \input{FILE} \\
\end{tabular}
\end{center}}{}


\IfFileExists{FILE}{%
\begin{center}
\captionof{table}{Caption is [AR07]}
\begin{tabular}{ll}
 AR07&  \input{FILE} \\
\end{tabular}
\end{center}}{}

enter image description here

Best Answer

\begin{minipage}{\textwidth}
\captionof{table}{Grenzwertverletzung [AL9]}
\begin{tabular}{ll}
 AL9&  \input{FILE} \\
\end{tabular}
\end{minipage}

will keep them together (but better really to use a table environment and let LaTeX move it away from the page break).

Related Question