Here's a LuaLaTeX-based solution. It employs two for
loops.
\documentclass{article}\usepackage{array} % for \extrarowheight length parameter and 'w' column type\usepackage{luacode} % for \luaexec macro\begin{document}\setlength\extrarowheight{2pt} % make squares 14pt wide and tall\setlength\tabcolsep{4pt}\begin{tabular}{|*{9}{w{c}{6pt}|}}\hline\luaexec{ for i=1,4 do for j=1,8 do tex.sprint( i*j .. "&" ) end tex.sprint( i*9 .. "\\\\ \\hline" ) end }\end{tabular}\end{document}