$i=0;
foreach ($x as $key=>$value)
{
if (fmod($i,2)) echo '';
echo '',$value,' | ';
if (fmod($i,2)) echo '
';
$i++;
}
this will output TR (row) each second time
ps: i haven't tested the code, so maybe you will need to add ! sign before fmod, if it doesn't output TR on first iteration, but on second iteration in the beginning...