I am trying to insert a multirow in a tikz matrix with a grid, so:
\documentclass{amsart}
\usepackage{tikz}
\usetikzlibrary{matrix,fit}
\begin{document}
\begin{tikzpicture}
\matrix (table) [%
matrix of nodes,
nodes in empty cells,
draw,
inner sep=0mm,
minimum size=7mm
] {%
\node[draw] {A}; & \node[draw] {B}; & \node[draw] {C}; & \node[draw] {D}; \\
\node[draw] {E}; & & & \node[draw] {G}; \\ };
\node[draw,fit=(table-2-2)(table-2-3)]{F};
\end{tikzpicture}
\end{document}
With ugly results. Is there a way to fix this? A better way to implement it? Thanks.

tikzpictureenvironments can span across pages, so TikZ matrices can't either. They're really not meant as a replacement for real LaTeX tables anyway, so you shouldn't expect too much from this approach. It can be useful if you're trying to do something special, most likely if you also need to place other TikZ elements. – Jake Jul 10 '11 at 05:43Package pgf Error: No shape named 'table-2-2' is known.Do you know how to fix this? – evolving Jan 28 '20 at 11:48execute at empty cell={\node[draw=none]{};}which seems to deactivate the auto-naming of nodes within the matrix. Usingnodes in empty cellsinstead seems to make it work again. – Hans Jan 17 '22 at 14:25nodes in empty cellsworks but introduces nodes withdraw. A possible fix for this is given in https://tex.stackexchange.com/a/386805/21773. – Hans Jan 17 '22 at 14:38