[Tex/LaTex] How to get rid of these excessive rules


enter image description here

\documentclass{article}%cannot be minimal
\usepackage{ifthen, xspace}

{\thexyz \and something\stepcounter{xyz} \\\hline}


Best Answer

This also removes the last two vertical lines:

{\thexyz \and something\stepcounter{xyz}%

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.