[Tex/LaTex] TikZ: how to draw chained tabular material

tablestikz-pgf

I am new to TikZ, and this is probably regarded as do-my-homework-for-me question. I'd like to draw a diagram like this:

enter image description here

First I need the very basic help on the segments themselves. I have tried nodes with a tabular environment:

\documentclass{standalone}
\usepackage{tikz,tabularx}
\begin{document}
\begin{tikzpicture}
\draw (0,0) node {
  \begin{tabularx}{4cm}{|X|X|}
  \hline
   \multicolumn{2}{|c|}{foo} \\
  \hline
    prev \hfill & \hfill next \\
    \hline
   \multicolumn{2}{|c|}{type: local\_par} \\
   \multicolumn{2}{|c|}{width: 20pt} \\
  \hline
  \end{tabularx}
};
\end{tikzpicture}
\end{document}

enter image description here

which comes close, but has a drawbacks:

  • I have the feeling that this is not the right way to go
  • I don't know how to make the line go from the "next" field to the next table. (Or the prev field of the previous table) as I don't know the position
  • The width of the table should be "minimum n points but stretch if needed".

Ultimately I'd like to have the arrows start in the field (next to the entry "prev","next" and "list"), similar to this example:

enter image description here

Best Answer

\documentclass[11pt]{scrartcl}
\usepackage{tikz}
\usetikzlibrary{shapes.multipart}

\begin{document}
\begin{tikzpicture}
  \node[rectangle split, rectangle split parts=5, 
       draw, minimum width=4cm,font=\small,
       rectangle split part align={center}] (t1)
    {             \textbf{Name : glyph}
     \nodepart{two}
                  prev \hspace*{4ex} next
     \nodepart{three}
                  width: 15pt  
     \nodepart{four}
                  height: 15pt 
     \nodepart{five}
                  list};
  \draw (t1.text split) -- (t1.two split);

  \begin{scope}[xshift=7cm]
    \node[rectangle split, rectangle split parts=5,
          draw, minimum width=4cm,font=\small,
         rectangle split part align={center}] (t2)
     {                \textbf{Name : glyph}
       \nodepart{two}
                      prev \hspace*{4ex} next
       \nodepart{three}
                      width: 15pt  
       \nodepart{four}
                      height: 15pt 
       \nodepart{five}
                      list}; 
    \draw (t2.text split) -- (t2.two split);
  \end{scope}

  \draw[->] (t1.two east) to [out=0, in=180](t2.text west);      
\end{tikzpicture}
\end{document}   

enter image description here