0

I have followed this thread to label a table as

\begin{center}
\begin{table}
\begin{tabular}{|c|}
 \hline
  contents of the table \\ [0.5ex] 
 \hline
\end{tabular}
\label{tab1:IFPositions}
\end{table}
\end{center}

However, if I then write \ref{tab1:IFPositions}, the resulting .pdf text returns ?? as the number of the reference, even if it redirects to the proper place. As far as I understand, this happens since there is no such thing as a table number, but I would like to know if there is a way for a table to be properly referenced instead of getting ?? as the number of reference.

Ulrike Fischer
  • 327,261
  • The table counter is actually the number of table captions, not the number of table environments. Throw in a \refstepcounter{table} if you don't want a \caption. – John Kormylo Mar 16 '22 at 15:06
  • Add a \caption as shown in the answer. And don't put a center environment around a table, that is rather pointless. – Ulrike Fischer Mar 16 '22 at 15:07
  • 1
    Additionally \begin{center}\begin{table} ... \end{table}\end{center} makes no sense. Use \begin{table}[htp] \centering ... \end{table} instead. Note that I added [htp] to \begin{table} you can also use [htbp] the default value in most classes are [tbp] – daleif Mar 16 '22 at 15:20

0 Answers0