How to label cells in a square grid

Here you have something to start with:


\matrix[matrix of nodes, nodes={minimum size=1cm, draw, anchor=center}, row sep=-\pgflinewidth, column sep=-\pgflinewidth](mygrid){%
R & B & W & G \\
B & W & G & R \\
W & G & R & B \\
G & R & B & W \\

enter image description here

Just for fun. Using some modulo arithmetic.

 \path (-1.5,6) coordinate(m10);
 \foreach \X in {1,...,8}
  {\foreach \Y in {1,...,8}
   \node[draw,minimum size=1cm,anchor=north] (m\X\Y) 
   at ([yshift=\pgflinewidth]m\X\the\numexpr\Y-1.south){\pft};
   \node[draw,minimum size=1cm,anchor=west] (m\X\Y) 
   at ([xshift=-\pgflinewidth]m\the\numexpr\X-1\relax\Y.east){\pft};
 \draw[red,dashed]  (-2,-2) grid (6,6); 

enter image description here

The red grid is just to guide the eye.