I want to put arrows beside a table. Here is my current code:
\renewcommand{\arraystretch}{1.5}
\begin{table}[!h]
\centering
\begin{tabular}{|C{2.0cm}|C{2.0cm}|C{2.0cm}|C{2.0cm}|}
\hline
\tikzmark{m1}\cellcolor{gray!75}\ifthenelse{\boolean{zeige_lsg}}{}{\space} & \ifthenelse{\boolean{zeige_lsg}}{}{} & \ifthenelse{\boolean{zeige_lsg}}{}{} & \ifthenelse{\boolean{zeige_lsg}}{}{}\\
\hline
\cellcolor{gray!75}\ifthenelse{\boolean{zeige_lsg}}{}{} & \ifthenelse{\boolean{zeige_lsg}}
{}{} & \ifthenelse{\boolean{zeige_lsg}}
{}{} & \ifthenelse{\boolean{zeige_lsg}}{}{}\\
\hline
\tikzmark{m2}\cellcolor{black}\ifthenelse{\boolean{zeige_lsg}}{}{} & \cellcolor{gray!75}\ifthenelse{\boolean{zeige_lsg}}{}{} & \cellcolor{gray!75}\ifthenelse{\boolean{zeige_lsg}}{}{} &
\tikzmark{m3}\cellcolor{gray!75}\ifthenelse{\boolean{zeige_lsg}}{}{}\\
\hline
\end{tabular}
% table
\begin{tikzpicture}[overlay, remember picture]
\node[yshift=0.5cm] (a) at (pic cs:m1) {\vphantom{h}};
\node[xshift=-1.45cm,yshift=-0.7cm] (a1) at (pic cs:m1) {$\boldsymbol{a}$};
\node[] (b) at (pic cs:m2) {\vphantom{g}};
\node[] (c) at (pic cs:m3) {\vphantom{i}};
\node[xshift=-4.7cm,yshift=-0.8cm] (c1) at (pic cs:m3) {$\boldsymbol{b}$};
\draw [<-, thick]([shift={(-1.2cm,0cm)}]a -| {pic cs:m1}) -- ([shift={(-1.2cm,0cm)}]b -| {pic cs:m2});
\draw [->, thick]([shift={(-0.5cm,-0.5cm)}]b -| {pic cs:m2}) -- ([shift={(1.2cm,-0.5cm)}]c -| {pic cs:m3});
\end{tikzpicture}
\end{table}
\renewcommand{\arraystretch}{1.0}
% small diagram
\begin{tikzpicture}
\node[] (a) at (0,0) {};
\node[] (b) at (-1,0) {1};
\node[] (c) at (0,-1) {1};
\node[] (d) at (-1,-1) {2};
\draw[->, thick] (b) -- (a);
\draw[->, thick] (d) -- (a);
\draw[->, thick] (c) -- (a);
\end{tikzpicture}
with this result
Somehow, it works, however, the arrows are not scaled well in their size and are not starting at the lower left edge and ending with the shape of the tabular.
I have the same scaling problem with the smaller diagram on the left, where the arrows are not getting scaled in the right way.
How can I improve this sketch?
