As shown in picture, is there a way to achieve this?
\documentclass[12pt,a4paper]{article}
\usepackage{rotating} % sidewaytables
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
\begin{sidewaystable}
\begin{tikzpicture}
\matrix (m) [matrix of math nodes,left delimiter=|, right delimiter=|] {
& K=3 & K=4 & K=5 & K=6 & K=7 & K=8 & K=9 & K=10 & K=11 & K=12\\
\hline
C=2 &4&7&10&12&14&16&18&20&&\\ \hline
C=3 &4&7&11&16&21&24&27&30&&\\ \hline
C=4 &4&7&11&16&22&29&36&40&&\\ \hline
C=5 &4&7&11&16&22&29&37&46&&\\ \hline
C=6 &4&7&11&16&22&29&37&46&&\\ \hline
C=7 &4&7&11&16&22&29&37&46&&\\ \hline
C=8 &4&7&11&16&22&29&37&46&&\\ \hline
C=9 &4&7&11&16&22&29&37&46&&\\ \hline
C=10&4&7&11&16&22&29&37&46&&\\
};
\draw[->,red,thick] (m-2-2.west) -- (m-2-3.east);
\draw[->,red,thick] (m-4-4.west) -- (m-4-7.east);
\draw[->,red,thick] (m-6-7.west) -- (m-6-8.east);
\draw[->,red,thick] (m-9-3.west) -- (m-9-6.east);
\end{tikzpicture}
\end{sidewaystable}
\end{document}
This works OK. But how do I make it into "tabular" look, ie the vertical lines that separates the columns.
Best Answer
This approach uses
stackengine
package's\topinset
macro to overlay the table with the arrows. Perhaps a better arrow could be constructed... I just added a\rightarrow
to the end of a long\rule
.The key to making the construction easy was reckoning the four lengths,
\cellv
,\cellh
,\vertoffset
, and\horzoffset
. Once that is done, the horizontal and vertical shifts for each arrow are integer multiples of\cellh
and\cellv
.