If I'm returning results via a while loop, how would I insert "</td><td>" every 25 results?
Thank you
Multiple Table Columns
Moderator: General Moderators
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Code: Select all
// in loop
++$column;
if ($column >= 25) {
echo "</td><td>";
$column = 1;
}(#10850)
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
I prefer the modulus operator.
Code: Select all
$column % 25 == 0 and $column != 0