Code:
\tikzstyle{matrici}=[
matrix of math nodes,
nodes in empty cells,
column sep=-\pgflinewidth, % to avoid double borders in contiguous cells
nodes={
draw,
align=center,
inner sep=0pt,
text width=1cm,
minimum height=1cm
}
]
\begin{tikzpicture}
\matrix[matrici,
column 1/.style={nodes={fill=blue!10}},
column 2/.style={nodes={fill=blue!10}},
column 3/.style={nodes={fill=blue!10}},
column 4/.style={nodes={fill=blue!10}},
] (X) {&&&&&&&\\};
\end{tikzpicture}
output:
there is no way ti fill the first 4 cells with a "cicle for"? Im forced to write this?
column 1/.style={nodes={fill=blue!10}},
column 2/.style={nodes={fill=blue!10}},
column 3/.style={nodes={fill=blue!10}},
column 4/.style={nodes={fill=blue!10}},
it will be fine somethig like
\foreach \x in {1,2,3,4}
fill the node (X-1-\x) with this color



.listwhich will use it. More clear at https://tex.stackexchange.com/questions/175616/tikz-matrix-style-for-combination-or-rows-and-columns – Ignasi Dec 28 '17 at 19:14mycols/.style={column #1/.style={nodes={fill=blue!10}}then you can call it withmycols/.list={1,...,4}– percusse Dec 29 '17 at 10:00