Sometimes, I observe different spaces introduced when I use whiledo in a tabular environment. How can I get rid of them?
Check the following MWE:
\documentclass{article}
\usepackage{ifthen}
\newcounter{qai}
\def\myand{&}
\begin{document}
\begin{tabular}{ |l|l|l|l|} \hline
Q & Q & Q & Q\ \hline
\setcounter{qai}{1}
\whiledo{\value{qai}<3}{Q\myand\stepcounter{qai}}
Q & Q \\hline
\end{tabular}
\end{document}
Note that the cells are not aligned.


