Here's a method of doing this that tries to take into account the length of the multicolumn entry. It's not all that sophisticated as all it does is assign a factor of the length of the desired entry to each of the columns (a better approach would be to ensure that the total length was at least the length of the multicolumn entry). It works by hooking in to the \pgfmatrixendcode
and \pgfmatrixemptycode
macros to adjust their widths accordingly. We have to be a bit sneaky as those macros are executed before the widths are actually known, so what they actually do is set stuff up so that when the widths are known then they are adjusted.
Here's the code:
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{matrix}
\makeatletter
\newdimen\multi@col@width
\newdimen\multi@col@margin
\newcount\multi@col@count
\multi@col@width=0pt
\tikzset{
multicol/.code={%
\global\multi@col@count=#1\relax
\global\let\orig@pgfmatrixendcode=\pgfmatrixendcode
\global\let\orig@pgfmatrixemptycode=\pgfmatrixemptycode
\def\pgfmatrixendcode##1{\orig@pgfmatrixendcode%
##1%
\pgfutil@tempdima=\pgf@picmaxx
\global\multi@col@margin=\pgf@picminx
\advance\pgfutil@tempdima by -\pgf@picminx
\divide\pgfutil@tempdima by #1\relax
\global\multi@col@width=\pgfutil@tempdima
\pgf@picmaxx=.5\multi@col@width
\pgf@picminx=-.5\multi@col@width
\global\pgf@picmaxx=\pgf@picmaxx
\global\pgf@picminx=\pgf@picminx
\gdef\multi@adjust@position{%
\setbox\pgf@matrix@cell=\hbox\bgroup
\hfil\hskip-\multi@col@margin
\hfil\hskip-.5\multi@col@width
\box\pgf@matrix@cell
\egroup
}%
\gdef\multi@temp{\aftergroup\multi@adjust@position}%
\aftergroup\multi@temp
}
\gdef\pgfmatrixemptycode{%
\orig@pgfmatrixemptycode
\global\advance\multi@col@count by -1\relax
\global\pgf@picmaxx=.5\multi@col@width
\global\pgf@picminx=-.5\multi@col@width
\ifnum\multi@col@count=1\relax
\global\let\pgfmatrixemptycode=\orig@pgfmatrixemptycode
\fi
}
}
}
\makeatother
\begin{document}
\begin{tikzpicture}
\matrix[matrix of nodes,nodes={draw}] {
A &|[multicol=3]| A long entry spanning three columns &&& A \\
A B &|[multicol=2]| A shorter entry && A & D E F \\
A B & A B & A B C D E F & A B\\
};
\end{tikzpicture}
\end{document}
Here's the result:

An important thing to note in the code is that the multirow entry is followed by the requisite number of empty entries (which makes me think that this probably wouldn't interact well with a style that put something in every empty node, incidentally).
There are obviously many ways in which this could be improved! And it only works for columns.
Update 2013-04-12 I've been informed (by email) that the following fixes an issue with centring the content in cells. Change the start of the definition of \multi@adjust@position
to:
\gdef\multi@adjust@position{%
\setbox\pgf@matrix@cell=\hbox\bgroup
\hfil\hskip-1.5\multi@col@margin
\hfil\hskip-.5\multi@col@width