Hey,
if you look at:
http://www.clubpixels.co.uk/test
you will see what's wrong. I have the correct amount of columns but now I need the items to automatically go accross and then start a new row for every 6 cells used. I've been told to use 'nested loops' but after searching that on Google, it doesn't seem to help me very much! All help is appreciated and the code at the moment is:
HTML Code:<?php include("config.php"); include("opendb.php"); $get_cats = mysql_query("SELECT * FROM `categories` ORDER BY `displayorder`") or die(mysql_error()); $get_info = mysql_query("SELECT * FROM `systeminfo`") or die(mysql_error()); $info = mysql_fetch_array($get_info); while($cats = mysql_fetch_array($get_cats)) { $get_rares = mysql_query("SELECT * FROM `rares` WHERE `catid`='".$cats['id']."'") or die(mysql_error()); echo("<h2>".$cats['name']."</h2><br> <center> <table width=\"90%\" border=\"0\"> "); $color1 = $info[stripe1]; $color2 = $info[stripe2]; $row_count = 0; while($rare = mysql_fetch_array($get_rares)) { $row_color = ($row_count % 2) ? $color1 : $color2; ?> <tr> <td width="15%" style="text-align:center;background-color:#<?php echo $row_color; ?>"><img alt="" src="<?php echo("".$info[imagepath]."".$rare['image'].""); ?>" onmouseover="Tip('<b><?php echo $rare['name']; ?></b>.<br><i>Last Updated: <?php echo $rare['lastedited']; ?></i>')" onmouseout="UnTip()"><br><?php echo $rare['value']; ?> CS</td> <td width="15%" style="text-align:center;background-color:#<?php echo $row_color; ?>"></td> <td width="15%" style="text-align:center;background-color:#<?php echo $row_color; ?>"></td> <td width="15%" style="text-align:center;background-color:#<?php echo $row_color; ?>"></td> <td width="15%" style="text-align:center;background-color:#<?php echo $row_color; ?>"></td> <td width="15%" style="text-align:center;background-color:#<?php echo $row_color; ?>"></td> </tr> <?php $row_count++; } echo("</table> </center><br> "); } ?>All help is greatly appreciated and will give +rep to any helpful information








Reply With Quote


