I am having trouble with using a loop inside a tabular environment:
\newcounter{it}
\setcounter{it}{0}
\begin{tabular}{ll}
\loop\ifnum\theit<4
\addtocounter{it}{1}
Q & A\\
\repeat
\end{tabular}
I receive an error about argument of loop having an extra } and the compilation stops at &. I don't get an error when it is a single column table, but even in that case the result is not as expected: I get a single execution of the loop in place of 4.
Can someone tell me what I am missing? Is there special considerations when using loops inside tabular?