I have the following document which is a table (tabularray) which I want to full with empty dotted lines. I have defined the command \fillwithdottedlines as you can see in MWE. Although the command works perfectly outside tblr environment it does not work inside. Why this happens and how I can fix it? Please uncomment the line with this command inside the table to see the error.
\documentclass[12pt]{article} \usepackage[a4paper, total={180mm,257mm},left=15mm,top=20mm]{geometry} \usepackage{tabularray} \makeatletter \newlength\dottedlinefillheight \setlength\dottedlinefillheight{9mm} \def\fillwithdottedlines#1 {% \begingroup \ifhmode \par \fi \hrule height \z@ \nobreak \setbox0=\hbox to \hsize{\hskip \@totalleftmargin \vrule height \dottedlinefillheight depth \z@ width \z@ \dotfill}% \cleaders \copy0 \vskip #1 \hbox{}% \endgroup } \makeatother \begin{document} \begin{tblr}{colspec={Q[0.5\linewidth-5pt,c]X[c]},row{1,2}={1cm,m},row{3}={15cm,m},vlines,hlines} \SetCell[c=2]{c} \large \textbf{TITLE} \\ \textbf{Subtitle 1} & \textbf{Subtitle 2} \\ & \\ %\fillwithdottedlines{10cm} & \fillwithdottedlines{10cm} \\ \end{tblr} \fillwithdottedlines{5cm} \end{document} 
\dotfill(or\makebox[2cm]{\dotfill}for a shorter line)?