# fill nodes/rows in tikz matrix [closed]

\documentclass[12pt,twoside]{report}
\usepackage{lmodern}
\usepackage[utf8]{inputenc}
\usepackage{mathtools}
\usepackage{tikz}
\tikzset{
table/.style={
matrix of nodes,
row sep=-\pgflinewidth,
column sep=-\pgflinewidth,
nodes={
rectangle,
draw=black,
align=center,
},
rows /. style={nodes={fill=gray!10, text=black}}
}
}

\begin{document}

Hello World...
\begin{table}
\centering
\begin{tikzpicture}
\matrix[table, ampersand replacement=\&] (TabA1)
{
A1 \& A2 \\
B1 \& B2 \\
};
\end{tikzpicture}
\caption{Glossary}
\label{tabA1}
\end{table}

\end{document}


I tried this: rows /. style={nodes={fill=gray!10, text=black}} in tikzset but it doesn't work. Also I tried in nodes fill=gray!10 but this also doesn't work?

I cannot believe that there is not something as simple as

row 1 /. style={nodes={fill=gray!10, text=black}}


but for all rows or equivalently all nodes?!?!

## closed as off-topic by marsupilam, Stefan Pinnow, Mensch, CarLaTeX, TeXnicianAug 16 '17 at 20:16

• This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

• You can mark inline code with a leading and trailing  (as Kurt did in his edit) – Skillmon Aug 16 '17 at 18:54
• ? How is what you want different than simply putting these options in the nodes={rectangle, ...} above ?? Maybe you tried and simply did not notice it had worked due to extreme lightness of the fill=gray!10 ...? – marsupilam Aug 16 '17 at 19:02
• ok I'm sorry... you are actually right -.- I did not notice... – Diger Aug 16 '17 at 19:09
• Oh well... I guess we learned a valuable lesson in debugging, then ! ;)` (to test with actually change-inducing settings, or something like that) – marsupilam Aug 16 '17 at 19:13
• I'm voting to close this question as off-topic because it's based off an erroneous assumption, and misleading as such, solved in the comments, and unlikely to be useful to anybody else. – marsupilam Aug 16 '17 at 19:20