I have 2 tables, and they have a common column so I want each row from the first table to point to the corresponding row of the second and the other way around. And also, if it is possible that the label be the value inside the cell.
Here is part of the first table:
\begin{table}[h]
\centering
\caption{Test files}
\label{my-label}
\resizebox{\textwidth}{!}{%
\begin{tabular}{|l|l|l|l|}
\hline
File name & Number of depots & Number of vehicles & Number of customers \\ \hline
0.txt \label{0txt1} \ref{0txt2} & 2 & 4 & 18 \\ \hline
1.txt \label{1txt1} \ref{1txt2} & 4 & 16 & 50 \\ \hline
2.txt \label{2txt1} \ref{2txt2} & 4 & 8 & 50
\end{tabular}
}
\end{table}
Here is part of the second table:
\begin{table}[h]
\centering
\resizebox{\textwidth}{!}{%
\begin{tabular}{l|l|l|l|l|l|l|l|l|l|l|l|l|}
\cline{2-13}
& \multicolumn{12}{c|}{\textit{\textbf{COST}}} \\ \cline{2-13}
& \multicolumn{3}{c|}{\textbf{NO OPTION}} & \multicolumn{3}{c|}{\textbf{REINITIALIZATION}} & \multicolumn{3}{l|}{\textbf{PERMUTATION}} & \multicolumn{3}{l|}{\textbf{PERTURBANCE}} \\ \hline
\multicolumn{1}{|c|}{\textit{File name}} & \multicolumn{1}{c|}{\textit{None}} & \multicolumn{1}{c|}{\textit{2Opt}} & \multicolumn{1}{c|}{\textit{All}} & \multicolumn{1}{c|}{\textit{None}} & \multicolumn{1}{c|}{\textit{2Opt}} & \multicolumn{1}{c|}{\textit{All}} & \multicolumn{1}{c|}{\textit{None}} & \multicolumn{1}{c|}{\textit{2Opt}} & \multicolumn{1}{c|}{\textit{All}} & \multicolumn{1}{c|}{\textit{None}} & \multicolumn{1}{c|}{\textit{2Opt}} & \multicolumn{1}{c|}{\textit{All}} \\ \hline
\multicolumn{1}{|l|}{0.txt \label{0txt2} \ref{0txt1}} & & & & & & & & & & & & \\ \hline
\multicolumn{1}{|l|}{1.txt \label{1txt2} \ref{1txt1}} & & & & & & & & & & & & \\ \hline
\end{tabular}
}
\end{table}
This is how the labels and references look for the first and second table:
\label{0txt1} \ref{0txt2}
\label{0txt2} \ref{0txt1}
.
At the moment I can only go from the second table to the first not the other way around.
Best Answer
The problem with linking to the line below the one you want seems to be inherent in tabulars. At first I compensated by putting an invisible target in the line above. Later I achieved the same effect using \raisebox (see hyperref and tabular).