I have several tables that are related to each other. Based on this question, I tried putting the table within a node within a matrix, but this constrains my tables to be arranged in an array. Since my tables do not naturally fit into an array, I need an alternative solution, but I have not been able to find one. Here's what I have so far:
\documentclass{article}
\usepackage{booktabs}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\matrix[ampersand replacement=&] {
\node (somenode) [shape=rectangle,fill=blue!20] at (0.0,0.0) {
\begin{tabular}{lc} \toprule
Name & Color \ \midrule
A.N. Other & Blue \
J. Bloggs & Grey \
\bottomrule
\end{tabular}
}; &
\node (somenode) [shape=rectangle,fill=orange!20] at (1.0,-2.0) {
\begin{tabular}{lc} \toprule
Name & Color \ \midrule
A.N. Other & Blue \
J. Bloggs & Grey \
\bottomrule
\end{tabular}
};
\
};
\end{tikzpicture}
\end{document}
which produces:
What I need to do is:
- Position the tables arbitrarily,
- Draw arrows between the tables to indicate their relations,
- Have text directly above the table (as a sort of caption),
which would end up looking something like this (I've repeated the first table for simplicity but tables 3 and 4 would naturally be different):
Any pointers would be appreciated.




