I am using the llncs document class and I found this answer matching my required task. However, I use cross-referencing very often in my document, and I noticed this the table number cross-referenced does not match the actual table.
I reduce the code (from said answer here):
\documentclass[runningheads]{llncs}
\usepackage{booktabs,siunitx}
\begin{document}
\section{Main Section}
\subsection{Sub-section I}
Checking cross-reference for Table \ref{tab:abc}
\title{Paper Title}
\begin{table}[htp]
\label{tab:abc} % <- added by me
\caption{Classification results of imbalance techniques}
\setlength{\tabcolsep}{0pt}
\begin{tabular*}{\textwidth}{
@{\extracolsep{\fill}}
l
@{\hskip 1ex}
*{5}{S[table-format=1.2]}
@{\hskip 1ex}
*{5}{S[table-format=1.2]}
@{\hskip 1ex}
*{5}{S[table-format=1.2]}
@{}
}
\toprule
TM &
\multicolumn{5}{c}{Precision} &
\multicolumn{5}{c}{Recall} &
\multicolumn{5}{c}{F1-Score} \\
\cmidrule(r{1ex}){2-6} \cmidrule(r{1ex}){7-11} \cmidrule{12-16}
& {R} & {S} & {A} & {B} & {D} & {R} & {S} & {A} & {B} & {D} & {R} & {S} & {A} & {B} & {D}\\
\midrule
Walk & 0.88 & 0.78 & 0.65 & 0.59 & 0.45 & 0.38 & 0.73 & 0.95 & 0.83 & 0.57 & 0.52 & 0.07 & 0.22 & 0.66 & 0.88 \\
Bike & 0.88 & 0.78 & 0.65 & 0.59 & 0.45 & 0.38 & 0.73 & 0.95 & 0.83 & 0.57 & 0.52 & 0.07 & 0.22 & 0.66 & 0.88 \\
\bottomrule
\end{tabular*}
\medskip
TM: Transportation mode
R: RF; S: RF-SMOTEd; A: AdaBoost; B: SMOTEBoost; D: DECOC
\end{table}
\end{document}
Output:
I want it to be (just) like this:
Checking cross-reference for Table 1.

Table~\ref{...}. Loosely related: I'd even more recommend to use thecleverefpackage. With it you would have noticed that you don't reference the table but the subsection. – Οὖτις Mar 17 '23 at 08:09