Have a look at the MWE below. In the pdf file I get questionmarks when reffering to the table, rather than a numeric reference. Even if I run LaTeX twice. Any ideas how this can be solved?
\documentclass{report}
\usepackage{float}
\begin{document}
we refer to table \ref{tab:ex}
\begin{table}[h]\label{tab:ex}
\centering
\begin{tabular}{|l|l|l|l|l|}
\hline
9 & 12 & 8 & 10 & 9 \\ \hline
10 & 7 & 8 & 13 & \textbf{50} \\ \hline
\end{tabular}
\end{table}
\end{document}
Best Answer
You missed a
\caption
in yourtable
. LaTeX uses the\caption
macro to number your tables thus without a caption you won't get a number and thus cannot reference the table.Try this:
A few things to remember:
\label
has to appear after the\caption
, because\caption
creates the number the\label
can then refer to.table
orfigure
environments with KOMA-Script or thecaption
package