The following example fixes some issues:
\coordinate
instead of \node
for \tikzmark
avoids additional spacing of a node.
The default depth of a row in a tabular
is set to 30 % of the baseline skip and multiplied with \arraystretch
.
The example defines the \RowDepth
outside of the tabular
, because inside the tabular
, \baselineskip
is reset to zero.
Package array
is loaded to get a more reliable position of the rules. In a tabular
, the vertical rules have its own space, if package array
is loaded. Without the package, the vertical rules are sticking to the left and right cell and might even overprint the cell contents (for ridiculous large rule widths).
Example code:
\documentclass[border=5pt]{standalone}
\usepackage{array}
\usepackage{tikz}
\newcommand{\tikzmark}[2][]{%
\tikz[remember picture,overlay]\coordinate[#1](#2);%
}
\begin{document}
\edef\RowDepth{\the\dimexpr\arraystretch\dimexpr.3\baselineskip\relax\relax}
\begin{tabular}{c|c|c}
12 & 13 & 32 \\
\hline
24 &
\tikzmark[xshift=-\tabcolsep, yshift=-\RowDepth]{A}%
\hfill 14\hfill
\tikzmark[xshift=\tabcolsep, yshift=-\RowDepth]{B}&
45\\
\hline
12 & 13 & 32\\
\hline
12 & very long long long text & 32
\end{tabular}
\begin{tikzpicture}[remember picture,overlay]
\draw[red](A) to[out=5,in=175](B);
\end{tikzpicture}
\end{document}

An alternative approach
The vertical position can be retrieved from a coordinate right below the row:
\\% end of the row
\noalign{\tikzmark{C}}% out of alignment, but correct vertical position
Then the perpendicular coordinate system can be used to address the start and end points: (A|-C)
and (B|-C)
Full example:
\documentclass[border=5pt]{standalone}
\usepackage{array}
\usepackage{tikz}
\newcommand{\tikzmark}[2][]{%
\tikz[remember picture,overlay]\coordinate[#1](#2);%
}
\begin{document}
\begin{tabular}{c|c|c}
12 & 13 & 32 \\
\hline
24 &
\kern-\tabcolsep\tikzmark{A}%
\hfill 14\hfill
\tikzmark{B}\kern-\tabcolsep &
45\\
\noalign{\hbox{\tikzmark{C}}}%
\hline
12 & 13 & 32\\
\hline
12 & very long long long text & 32
\end{tabular}
\begin{tikzpicture}[remember picture,overlay]
\draw[red](A|-C) to[out=5,in=175](B|-C);
\end{tikzpicture}
\end{document}
This method deals well with rows, where the depth is not easily known and would have to be measured otherwise.