[Tex/LaTex] Make table and text appear in the same page

tables

I have this page with section Appendix defined like this

\section{Appendix}

Then I start the table. But somehow the table appears in the next page. The table is small enough to fit in the same page.

I tried with

\begin{table}[!htbp] 
....................
\end{table}

But it doesn't seem to help

Best Answer

Some bad example for tables, but nice to show the floating around of table at the 'wrong' position.

\documentclass{article}
\usepackage{caption}

\begin{document}


\appendix
\begin{center}
\begin{tabular}{ll}
\hline
A & B \tabularnewline
\hline
C & D \tabularnewline
\hline
A & B \tabularnewline
\hline
C & D \tabularnewline
\hline
A & B \tabularnewline
\hline
C & D \tabularnewline
\hline
A & B \tabularnewline
\hline
C & D \tabularnewline
\hline
A & B \tabularnewline
\hline
C & D \tabularnewline
\hline
A & B \tabularnewline
\hline
C & D \tabularnewline
\hline

\end{tabular}
\captionof{table}{Not Floating around table}
\end{center}

\begin{table}
\centering
\begin{tabular}{ll}
\hline
A & B \tabularnewline
\hline
C & D \tabularnewline
\hline
A & B \tabularnewline
\hline
C & D \tabularnewline
\hline
A & B \tabularnewline
\hline
C & D \tabularnewline
\hline
A & B \tabularnewline
\hline
C & D \tabularnewline
\hline
A & B \tabularnewline
\hline
C & D \tabularnewline
\hline
A & B \tabularnewline
\hline
C & D \tabularnewline
\hline

\end{tabular}
\caption{Floating around table}
\end{table}

\end{document}

enter image description here

Note

Please look a the screen shot: Although defined as 2nd table (Table 2) it is positioned as 1st one and vice versa.