Monkuar Posted June 29, 2009 Share Posted June 29, 2009 $color_one = '</tr>'; $color_two = '</td>'; static $i = 0; $color = ($i % 2) ? $color_one : $color_two; $i++; global $ibforums; //caption is sname return <<<EOF <td width=33%><fieldset><legend>{$info['sname']}</legend> <div class="p3"> Added on {$info['date']} by {$info['author']}</a> </div> <table class="ftb"> <tr><td nowrap class="ce desc"> Public<br> Views: {$info['views']}<br><br> Rank: {$info['rating']}<br><br> Comments: 0<br><br> </td> <td class="lc ib"><span class='linkthru'><a href="index.php?download={$info['id']}"><img src='{$info['screenshot1']}' border='0' align='center' width='100' height='100' /></a></span> <br> </td></tr></table> </fieldset><br> $color How can I use: $color_one = '</tr>'; $color_two = '</td>'; static $i = 0; $color = ($i % 2) ? $color_one : $color_two; $i++; that Code to make the above above code spit out 3 rows each then a break tag? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/164035-static-i-0/ Share on other sites More sharing options...
Ken2k7 Posted June 29, 2009 Share Posted June 29, 2009 That doesn't make sense. Use a loop that iterates 3 times and but a break tag where you want it. Quote Link to comment https://forums.phpfreaks.com/topic/164035-static-i-0/#findComment-865349 Share on other sites More sharing options...
Monkuar Posted June 29, 2009 Author Share Posted June 29, 2009 Sir please please give me that information, Im using old old code from 2002 but I enahcned with u guys best code around!! : So it would be like this? $color_one = '</tr>'; $color_two = '</br>'; static $i = 0; $color = ($i % 3) ? $color_one : $color_two; $i++; Quote Link to comment https://forums.phpfreaks.com/topic/164035-static-i-0/#findComment-865362 Share on other sites More sharing options...
Monkuar Posted June 29, 2009 Author Share Posted June 29, 2009 Any help on this issue sir? Quote Link to comment https://forums.phpfreaks.com/topic/164035-static-i-0/#findComment-865445 Share on other sites More sharing options...
jackpf Posted June 29, 2009 Share Posted June 29, 2009 Not entirely sure what you mean but somethin like this for($i = 0; $i < howmnylinesyouwnt; $i++) { echo '<tr><td>table row</td></tr>'; if($i % 3 == 0) { echo '<br />'; } } Althouh why you want a line break outside a table cell doesn't mke sense to me. And I doubt it's valid html. Quote Link to comment https://forums.phpfreaks.com/topic/164035-static-i-0/#findComment-865511 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.