I want to insert a \table in \enumerate environment and I have something like this:
\begin{enumerate}
\item Item 1.
\item Item 2.
\item \begin{table}[htbp]
\textbf{\caption{Table1 Caption}}
\centering
\begin{tabular}{c c}
\hline\hline
Value 1 & Value 2\\
\hline
r1c1 & r2c2\\
r2c1 & r2c2\\
r3c1 & r3c2\\
\hline
\end{tabular}
\label{table1}
\end{table}
\item \begin{table}[htbp]
\textbf{\caption{Table 2 Caption}}
\centering
\begin{tabular}{ccc}
\hline\hline
Value 1 & Value 2 & Value 3\\
\hline
r1c1 & r1c2 & r1c3\\
r2c1 & r2c2 & r2c3\\
r3c1 & r3c2 & r3c3\\
\end{tabular}
\label{table2}
\end{table}
\item \ref{table1} and \ref{table2}
\end{enumerate}
But when I compile the latex document the \enumerate number are no where near the table. Also when I refer to label "table1" and "table2" it shows up as 3 and 4 respectively (for extra info this part is in subsection 3.3 and these are the only two tables in the whole document).
How do I use \table environment with \enumerate environment. I have seen people use just \tabular with \enumerate but I want to use \table as it gives me an easy option to define \caption and \label.
Also regarding table labeling I am assuming it has something to do with subsection number but I can't really figure it out.
I would really appreciate any help regarding this matter.