Grid with a number

I know how to create a grid by using TikZ and the following:

\documentclass[a4paper,10pt,table]{book}
\usepackage{tikz}
\usetikzlibrary{arrows,plotmarks}
\multiput(0,0)(1,0){37}{\line(0,1){#1}}
\put(0,0){\line(1,0){36}}
\multiput(0,1)(0,1){#1}{\line(1,0){36}}
\end{picture}}\medbreak}

\begin{document}
\end{document}


My aim is now to add a counter, for example a big number in the upper left corner area of my grids. Unfortunately, I am not able to adapt the previous code.

• I'm confused. You are loading TikZ but seem not to make use of it. Would you be interested in a TikZ based solution? – marmot Apr 17 '18 at 17:01
• A solution using Tikz would be as good. Thank you for your help. – jowe_19 Apr 17 '18 at 17:08

\documentclass[a4paper,10pt,table]{book}
\usepackage{tikz,tikzpagenodes}
\usetikzlibrary{calc}
\draw (0,0) grid[step={\linewidth/36}] (\linewidth,{\linewidth/36});
\node[anchor=south west,gray] at (0,{\linewidth/36}) {#2};
\end{tikzpicture}\medbreak}