Monkuar Posted June 29, 2009 Share Posted June 29, 2009 Ok I grabbed all info exactly from my Database! $color_one = "<td width=33%><fieldset><legend> {$row['sname']} </legend> <div class=\"p3\"> Added on {$row['date']} by {$row['author']}</a> </div> <table class=\"ftb\"> <tr><td nowrap class=\"ce desc\"> Public<br> Views: {$row['views']}<br><br> Rank: {$row['rating']}<br><br> Comments: 0<br><br> </td> <td class=\"lc ib\"><span class='linkthru'><a href=\"index.php?download={$row['id']}\"><img src='{$row['screenshot1']}' border='0' align='center' width='100' height='100' /></a></span> <br> </td></tr></table> </fieldset> "; $color_two = 'ce'; static $i = 0; $color = ($i % 6) ? $color_one : $color_two; $i++; $this->output .= $color; That currently display's exactly this,: NOW I need it to span 3 rows across and do a break tag, like this: I've been trying to use some type of PHP Code that makes it like that, i'm using the 1 in my code as u see but it's not doing it. Please please God.. thanks.. this is my 3rd thread and 20hours on this I cant figure it out, Thanks! It has something to do with "; $color_two = 'ce'; static $i = 0; $color = ($i % 6) ? $color_one : $color_two; $i++; $this->output .= $color; With that [my above code I posted Quote Link to comment https://forums.phpfreaks.com/topic/164088-urgrent-wow-ims-o-close-to-get-this-done-omg/ Share on other sites More sharing options...
JJ2K Posted June 29, 2009 Share Posted June 29, 2009 Hey I replied to your other thread with a CSS approach Quote Link to comment https://forums.phpfreaks.com/topic/164088-urgrent-wow-ims-o-close-to-get-this-done-omg/#findComment-865584 Share on other sites More sharing options...
iSE Posted June 29, 2009 Share Posted June 29, 2009 The way I normally do it is by setting a variable outside the loop which is the number of columns you want. Then, if the current column == that variable, start new row. e.g: $max_cols = 3; // This is the number of columns you want per row $column = 0; // This sets the counter at 0 while (something is true) { $column++; // Increment to the correct column number echo '<td>something here</td>'; // Your individual box if ($column == $max_cols) { echo '</tr><tr>'; // Start new row $column = 0; // Reset counter } } If you prefer to use divs and spans, just start a new div or whatever it is you want to do. If you need more explanation, let me know. Quote Link to comment https://forums.phpfreaks.com/topic/164088-urgrent-wow-ims-o-close-to-get-this-done-omg/#findComment-865586 Share on other sites More sharing options...
Monkuar Posted June 29, 2009 Author Share Posted June 29, 2009 <table width=100%> </tr><tr valign=top><td width=33%> <td width=33%><fieldset><legend> {$row['sname']} </legend> <div class=\"p3\"> Added on {$row['date']} by {$row['author']}</a> </div> <table class=\"ftb\"> <tr><td nowrap class=\"ce desc\"> Public<br> Views: {$row['views']}<br><br> Rank: {$row['rating']}<br><br> Comments: 0<br><br> </td> <td class=\"lc ib\"><span class='linkthru'><a href=\"index.php?download={$row['id']}\"><img src='{$row['screenshot1']}' border='0' align='center' width='100' height='100' /></a></span> <br> </td></tr></table> </fieldset> </td></tr> That's my HTML. man im so lost on how to set everything up.. OMG PHP So confusing i love it tho.. Thanks for your idea.. Quote Link to comment https://forums.phpfreaks.com/topic/164088-urgrent-wow-ims-o-close-to-get-this-done-omg/#findComment-865588 Share on other sites More sharing options...
iSE Posted June 29, 2009 Share Posted June 29, 2009 Right well you need to find the code that loads that HTML for each box. It also looks like your using a template system from all the {$row['something']}'s. Depending upon which template system you're using, you may be able to set the number of columns per row using that. If you feel like delving into the dark side a little bit, find the loop in the php script which loads that html file and adjust it using the code I suggested. Quote Link to comment https://forums.phpfreaks.com/topic/164088-urgrent-wow-ims-o-close-to-get-this-done-omg/#findComment-865595 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.