\documentclass{article}%cannot be minimal
\usepackage{longtable}
\usepackage{ifthen, xspace}
\newcounter{xyz}
\setcounter{xyz}{1}
\def\and{&\xspace}
\begin{document}
\begin{longtable}{|*2{c|}}\hline
\whiledo{\value{xyz}<6}%
{\thexyz \and something\stepcounter{xyz} \\\hline}
\end{longtable}
\end{document}
[Tex/LaTex] How to get rid of these excessive rules
loopstables
Best Answer
This also removes the last two vertical lines:
It's funny that these lines appear if I take
\\\hline
out of this\ifthenelse
, similar if I put\end{longtable}
after that (even with%
before the line break). And, actually, I don't like ending an environment within a loop construction.