while in üstüne $i=1 diye değişken tanımla
while içinde $i++ de
sonra if($i%2==0){
echo "</tr></tr>";
}

de böyle mantık