I've got the following code:
\begin{center}
\sffamily
\captionof{table}{Codexample}
\begin{tabular}{ll}
\topule[2.5pt]
exampleline & example \\
...
\bottomrule[2.5pt]
\end{tabular}
\end{center}
I've added the \captionof{table}{..} in order to give my table a heading. I assume that the whole table is a floating object (I hope this is the right English expression) and LaTex decides more or less where to put it.
My problem is: In my document I've got some text before the table. LaTex produces an ugly PDF document: The title of the table is on one page and the table itself on the next page. How to correct that?
\begin{table}\centeringand\end{table}instead ofcenter; change\captionof{table}into\caption. – egreg Jul 08 '14 at 12:05