我有两个不同的表格,带有两个不同的标签:\label{lab1}
和\label{lab2}
。这些表格是在表格生成器网站,我正在使用 Overleaf。当我引用这两个表格\ref{lab1}
和时\ref{lab2}
,文本对两个表格显示相同的数字:表格 xy 和表格 xy,而不是表格 xy 和表格 xz
以下是代码:
\begin{table}[!ht]
\label{lab1}
\caption{Text1}
\resizebox{\textwidth}{!}{%
\begin{tabular}{ll}
\rowcolor[HTML]{EFEFEF}
\multicolumn{1}{c}{\cellcolor[HTML]{EFEFEF}\textbf{Title 1}} & \multicolumn{1}{c}{\cellcolor[HTML]{EFEFEF}\textbf{Title 2}} \\ \hline
ACM Digital Library (5) & Some Text1 \\ \hline
IEEE Xplore Digital Library (6) & Some Text2 \\ \hline
Scopus (61) & Some Text3 \\ \hline
Springer Link (40) & Some Text4 \\ \hline
ScienceDirect (23) & Some Text5 \\ \hline
Google Scholar (703) & Some Text6 \\ \hline
\end{tabular}%
}
\end{table}
\begin{table}[!ht]
\label{lab2}
\caption{Text2}
\resizebox{\textwidth}{!}{%
\begin{tabular}{ll}
\rowcolor[HTML]{EFEFEF}
\multicolumn{1}{c}{\cellcolor[HTML]{EFEFEF}\textbf{Title1}} & \multicolumn{1}{c}{\cellcolor[HTML]{EFEFEF}\textbf{Title2}} \\ \hline
Text1 & \begin{tabular}[c]{@{}l@{}}aaaaaaaa\end{tabular} \\ \hline
Text2 & \begin{tabular}[c]{@{}l@{}}bbbbbbbbb\end{tabular} \\ \hline
Text3 & ccccccccc \\ \hline
Text4 & \begin{tabular}[c]{@{}l@{}}ddddddddd\end{tabular} \\ \hline
\end{tabular}%
}
\end{table}
答案1
每个表后面都需要\label{...}
给出\caption{...}
,以便标签可以与更新后的表号相匹配。因此,您需要在两个表中交换\label
和。\caption