user55
09-26-2007, 03:40 PM
Hi,
How can I rearrange my table rows to display like the following:
I would like it to display like this:
first row results
first row results
first row results
second row results
second row results
second row results
Right now it alternates and it displays like this:
first row results
second row results
first row results
echo "<table cellpadding=\'2\' cellspacing=\'0\'>";
echo "<tr>";
echo "<td class=\"th\" >COL1</td>";
echo "<td class=\"th\" >COL2</td>";
echo "<td class=\"th\" >COL3</td>";
echo "</tr>";
if($result && mysql_num_rows($result) > 0)
{ while($row = mysql_fetch_array($result))
{
echo ('<tr>');//first row
echo ('<td>'.$row[1].'</td>');
echo ('<td>'.$row[2].'</td>');
echo ('<td>'.$row[3].'</td>');
echo ('</tr>');
echo ('<tr>');//second row
echo ('<td>'.$row[4].'</td>');
echo ('<td>'.$row[5].'</td>');
echo ('<td>'.$row[6].'</td>');
echo ('</tr>');
} // end while
} // end if results
echo ('</tr></table>');
How can I rearrange my table rows to display like the following:
I would like it to display like this:
first row results
first row results
first row results
second row results
second row results
second row results
Right now it alternates and it displays like this:
first row results
second row results
first row results
echo "<table cellpadding=\'2\' cellspacing=\'0\'>";
echo "<tr>";
echo "<td class=\"th\" >COL1</td>";
echo "<td class=\"th\" >COL2</td>";
echo "<td class=\"th\" >COL3</td>";
echo "</tr>";
if($result && mysql_num_rows($result) > 0)
{ while($row = mysql_fetch_array($result))
{
echo ('<tr>');//first row
echo ('<td>'.$row[1].'</td>');
echo ('<td>'.$row[2].'</td>');
echo ('<td>'.$row[3].'</td>');
echo ('</tr>');
echo ('<tr>');//second row
echo ('<td>'.$row[4].'</td>');
echo ('<td>'.$row[5].'</td>');
echo ('<td>'.$row[6].'</td>');
echo ('</tr>');
} // end while
} // end if results
echo ('</tr></table>');