Dans l'environnement `tabular`, `\baselineskip` est 0. Si on utilise 0mm au lieu de -3.6mm les deux tableaux donnent le même affichage :
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tabular}{c|c|c}%
&\tikz[remember picture, overlay]{\coordinate[name=test1,yshift=0];}&\tikz[remember picture,
overlay]{\coordinate[name=test2,yshift=0];}\\
\hline
A&1&2\\
\hline
B&4&8\\
\hline
\end{tabular}
\tikz[remember picture,overlay]{%
\draw[out=30,in=150] (test1) to (test2);
}
\begin{tabular}{c|c|c}%
&\tikz[remember picture, overlay]{\coordinate[name=test1,yshift={-0.3*\baselineskip}];}&
\tikz[remember picture, overlay]{\coordinate[name=test2,yshift={-0.3*\baselineskip}];}\\
\hline
A&1&2\\
\hline
B&4&8\\
\hline
\end{tabular}
\tikz[remember picture,overlay]{%
\draw[out=30,in=150] (test1) to (test2);
}
\end{document}
[![enter image description here][1]][1]
[1]: https://i.stack.imgur.com/luxoG.png
![alt text][1]
Ou plus facile avec `\tikzmark` :
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{tikzmark}
\begin{document}
\begin{tabular}{c|c|c}%
&\tikzmark{test1}&\tikzmark{test2}\\
\hline
A&1&2\\
\hline
B&4&8\\
\hline
\end{tabular}
\tikz[remember picture,overlay]{%
\draw[out=30,in=150] (pic cs:test1) to (pic cs:test2);
}
\end{document}
[1]: https://texnique.fr/osqa/upfiles/luxoG.png