Jump to content

Archived

This topic is now archived and is closed to further replies.

hostfreak

While loop question

Recommended Posts

I am looping through results of locations and need to display them in a table, two columns arcoss then have it go to the next row. I am not sure how to do that though?

Share this post


Link to post
Share on other sites
[code]
$i=1;
echo '<table width="200" border="0" cellpadding="0" cellspacing="0">';
while ($num < 10) {
if ($i == 1) {
  echo '<tr>';
}
elseif ($i == 3) {
  echo '</tr>';
  $i=1;
}
echo '<td>$location</td>';
$i++;
}
echo '</table>';
[/code]


i think that should work :)

Liam

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.