I have a tikz matrix as the one in the code below which contains some empty cells. (Don't care about issues with column and row separations. I left that out for the sake of simplicity.)
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
\begin{tikzpicture}[
table/.style={
matrix of nodes,
nodes in empty cells,
nodes = {fill=gray, draw = black},
}
]
\matrix (test) [table] {
1 & 2 & 3 \\
4 & & 5 \\
};
\end{tikzpicture}
\end{document}
I use the nodes in empty cells
option since I want the cells to be adressable by the matrix name and column/row number. One implication of this option is that every empty cell contais a node
without content which, however, has the same style applied as all other nodes.
I am searching for a way to give the empty cells a different style (different fill color and no border) without
- losing the adressability of the single cells
- having to manually add a style to every empty cell.
Is there such an option that I did not find yet or do I have to "mimic" the nodes in empty cells
option myself to plug in some different style?