# Reference to the table does not appear [duplicate]

Although I have a valid label for a table, the reference to that label does not appear in the PDF file, or sometimes appear as ?? if I put a tilde before \ref.

The code is the following:

\documentclass{article}

\begin{document}

\begin{table}[!t]
\footnotesize
\parbox{.50\linewidth}{
\centering
\begin{tabular}{l|l}
Example plot \\ \hline
A & 22 \% \\
B & 54 \% \\
\end{tabular}
}
\label{tab:example}
\caption{Example plot}
\end{table}

Looking the table \ref{tab:example}

\end{document}


Any thought?

• The most frequently asked question of all time: put the \label after \caption otherwise you are labelling the section or as here nothing at all, rather than the caption. Jun 20 '13 at 14:40
• Jun 20 '13 at 14:52
• Welcome to TeX.SX! You can have a look on our starter guide to familiarize yourself further with our format. And David is right, I guess your question will be closed soon as a duplicate.
– mafp
Jun 20 '13 at 14:53
• It works. Thanks! But I wonder why it worked in another latex template with the order above. Jun 20 '13 at 15:33