How can I make a table with some lines superimposed?

By generating a table, do you mean making one in the first place?

I recommend breaking something like this down into individual tasks (like the list you made) and approaching it one step at a time, starting from a very basic structure and gradually building it up. Each of these tasks can be found in various examples across the internet (particularly here) pretty quickly, but this should get your started if you need more of a direct starting point.

code

\documentclass{article}
\usepackage{tikz}
\usepackage{fontspec}
\setmainfont{Arial}
\usetikzlibrary{fit,matrix}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}[mycircle/.style={draw,circle, minimum size=1cm}]
% table
  \matrix[draw=black,row sep=0.75cm,column sep=0.75cm]{
    \node {}; & \node {group 1}; & \node {}; \\
    \node {a}; & \node {b}; & \node {a}; \\
    \node {aa}; & \node {aa}; & \node {bb}; \\
    \node {..}; & \node {..}; & \node {..}; \\
    \node {6}; & \node(baa6)[draw=red,text=black,mycircle] {6}; & \node {6}; \\
    \node(aaa5) {5}; & \node(baa5) {5}; & \node(abb5) {5}; \\
    \node(aaa4)[draw=red,text=black,mycircle] {4}; & \node {4}; & \node {4}; \\
    \node {3}; & \node {3}; & \node(abb3) {3}; \\
    \node(aaa2) {2}; & \node {2}; & \node(abb2) {2}; \\
  };
% straight line between 5's
  \draw(aaa5)--(baa5)--(abb5);
% dashed lines above 2's
  \draw[dashed](aaa2.north west)--(abb2.north east);
% the 3,5 node
  \node(aab35)[draw=red,text=black,mycircle,above=0.05cm of abb3] {3.5};
% string of red circular nodes
  \draw[red](aaa4)--(baa6)--(aab35);
\end{tikzpicture}
\end{document}

result

enter image description here


Here is a solution with pst-node and arydshln. Is consists in using an ordinary tabularx environment and defining the relevant cells as nodes of various types and linking them with node connections.

It compiles with xelatex only.

\documentclass{article}
\usepackage{array, tabularx, arydshln}
\usepackage{geometry} 
\usepackage{pst-node, multido}
\usepackage{fontspec}
\setsansfont{Arial}

\begin{document}
\begin{table}[h]
  \sffamily\renewcommand\arraystretch{1.8}\centering
  \fontsize{10.5}{13}\selectfont
  \psset{linecolor=red}
  \makebox[0pt]{\begin{tabularx}{1.2\textwidth}{|*{12}{ >{\centering\arraybackslash}X|}}
    \multicolumn{12}{c}{TITLE} \\
    \hline
    \multicolumn{12}{|c|}{SOME INFORMATION} \\
    \hline
    \multicolumn{4}{|c|}{GROUP 1} & \multicolumn{2}{c|}{GROUP 2} & \multicolumn{2}{c|}{GROUP 3} & \multicolumn{4}{c|}{GROUP 4} \\
    A & B & A & B & \multicolumn{2}{c|}{C} & \multicolumn{2}{c|}{D} & & & & \\
    AA & AA & BB & BB & CC & DD & AA & BB & EE & FF & GG & HH \\
    \hline
    10 & 10 & 10 & 10 & 10 & 10 & 10 & 10 & 10 & 10 & 10 & 10 \\
    9 & 9 & 9 & 9 & 9 & 9 & 9 & 9 & 9 & 9 & 9 & 9 \\
    8 & 8 & 8 & 8 & 8 & 8 & 8 & 8 & \circlenode{c9}{8} & 8 & 8 & 8 \\
    \hdashline
    7 & 7 & 7 & 7 & 7 & 7 & 7 & 7 & 7 & \circlenode{c10}{7} & 7 & 7 \\
    6 & \circlenode{c2}{6} & 6 & 6 & 6 & 6 & 6 & 6 & 6 & 6 & 6 & 6 \\
    \rnode{R1}{5} & \rnode{R2}{5} & \rnode{R3}{5} & \rnode{R4}{5} & \rnode{R5}{5} & \rnode{R6}{5} & \rnode{R7}{5} & \rnode{R8}{5} & \rnode{R9}{5} & \rnode{R10}{5} & \rnode{R11}{\circlenode{c11}{5}} & \rnode{R12}{5} \\
    \circlenode{c1}{4} & 4 & 4 & 4 &\circlenode{c5}{4} & 4 & \rnode{t7}{4} & \circlenode{c8}{4} & 4 & 4 & 4 & 4 \\
    3 & 3 & 3 & 3 & 3 & 3 & \rnode{b7}{3} & 3 & 3 & 3 & 3 & 3 \\
    \hdashline
    2 & 2 & \circlenode{c3}{2} & \circlenode{c4}{2} & 2 & 2 & 2 & 2 & 2 & 2 & 2 & \circlenode{c12}{2} \\
    1 & 1 & 1 & 1 & 1 & \circlenode{c6}{1} & 1 & 1 & 1 & 1 & 1 & 1 \\
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
    \hline
    \end{tabularx}}
  \midAB(t7)(b7){m7}\rput(m7){\circlenode[framesep=0pt]{c7}{3,5}}%
  \multido{\ia=1+1, \ib=2+1}{11}{\ncline{c\ia}{c\ib}}
  \pnode[-0.85cm, 0](R1){R0}
  \pnode[0.85cm, 0](R12){R13}
  \psset{linewidth=0.5pt, linecolor=black, nodesep=3pt}
  \multido{\ia=0+1, \ib=1+1}{13}{\ncline{R\ia}{R\ib}}
\end{table}

\end{document} 

enter image description here

Tags:

Nodes

Tables