Code proposé par Jean-Côme Charpentier

\documentclass{article}
 
\makeatletter
\let\@nil\relax
\def\Row#1 {%
  \begingroup
  \par\centering
  \baselineskip=0pt
  \nointerlineskip
  \printrow#1\@nil
  \par\vskip-\fboxrule
  \endgroup
}
\def\printrow#1#2\@nil{%
  \fbox{%
    \hbox to\Boxwd{%
      \hss
      \vbox to\Boxht{%
        \vss#1\vss
      }%
      \hss
    }%
  }%
  \hskip-\fboxrule
  \def\@arg{#2}%
  \ifx\empty\@arg
    \let\next\relax
  \else
    \let\next\printrow
  \fi
  \expandafter\next\@arg\@nil
}
\def\setBoxdim#1#2{%
  \def\Boxht{#2}%
  \def\Boxwd{#1}%
}
\makeatother
 
\begin{document}
 
\setBoxdim{8mm}{6mm}
\Row1
\Row11
\Row121
\Row1331
\Row14641
\Row{1}{5}{10}{10}{5}{1}
 
\end{document}
Flattr