this is my simplified code:
Text ... \ref{table:x} and \ref{table:y}.
\begin{table}[!h]
\begin{tabular}{lcc}
\toprule
AAA & BBB & CCC\\
\midrule
DDD & \( 1 \) & \( A \) \\
EEE & \( 2 \) & \( B \) \\
FFF & \( 3 \) & \( C \) \\
HHH & \( 4 \) & \( D \) \\
\bottomrule
\end{tabular}
\label{table:x}
\caption{something about table x}
\end{table}
\begin{table}[!h]
\begin{tabular}{lcc}
\toprule
AAA & BBB & CCC\\
\midrule
DDD & \( 1 \) & \( A \) \\
EEE & \( 2 \) & \( B \) \\
FFF & \( 3 \) & \( C \) \\
HHH & \( 4 \) & \( D \) \\
\bottomrule
\end{tabular}
\label{table:y}
\caption{something about table y}
\end{table}
My problem is related to the fact that when i compile on my .pdf i get this as result:
Text...?? and ??.
How can i solve this? It seems like \ref is not working. I think that i am doing something wrong with \label but i can't understand what. Thank you for your help
\labelalways has to be placed after (or within) the\caption. Edit: see https://tex.stackexchange.com/questions/32325/why-does-an-environments-label-have-to-appear-after-the-caption – Torbjørn T. Apr 27 '17 at 12:25