\documentclass[tikz, border=2mm]{standalone}\begin{document}\begin{tikzpicture}\foreach \i in {0,1,2,...,8}{ \foreach \j [evaluate=\j as \num using int(9*(4-\j)+\i+1)] in {1,2,3,4} \node[fill=blue!15, minimum size=1cm, draw] at (\i,\j) {\num};}\end{tikzpicture}\end{document}