TransWikia.com

Drawing a table with arrows crossing each other in LaTeX

TeX - LaTeX Asked by Gada on May 18, 2021

Can one help me to create the following table in LaTeX. Thank you!

enter image description here

One Answer

Something to begin with (you can try and answer to your other question about arrow and tabulars with the same approach).

documentclass{article}
usepackage{tikz}
usetikzlibrary{positioning}

tikzset{every node/.style={inner xsep=10pt, inner ysep=6pt}}

newcommand{tikzmark}[2]{tikz[remember picture] node (#1) {#2};}

begin{document}
    sf
    
    begin{tabular}{|c|c|c|}
        hline
        tikzmark{a1}{textbf{AA}} & tikzmark{b1}{} & tikzmark{c1}{textbf{BB}} 
        hline
        tikzmark{a2}{A} & tikzmark{b2}{} & tikzmark{c2}{1} 
        hline
        tikzmark{a3}{B} & tikzmark{b3}{} & tikzmark{c3}{2} 
        hline
        tikzmark{a4}{C} & tikzmark{b4}{} & tikzmark{c4}{3} 
        hline
        tikzmark{a5}{D} & tikzmark{b5}{} & tikzmark{c5}{4} 
        hline
    end{tabular}

begin{tikzpicture}[%
    overlay,
    remember picture,
    arr/.style={-stealth, blue, line width=2pt}]
    
    foreach k in {2,...,5}
        draw[arr] (ak.east) -- (ck.west);

    node[below=20pt] (ending) at (b5.south) {};
    draw[arr] (b1.south) -- (ending);
end{tikzpicture}

end{document}

tabular with crossing arrows

Correct answer by SebGlav on May 18, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP