Hello, this code bellow is a part of a mysql query wich puts originaly 10 images per row 75 * 75 in 4 rows, my problem is that when i change the limit of the query to 7 images per row in 4 rows so it's 24 in total insteed of 40, nothing will center, everyting is huging the left side of the page the original code as said above, outputs 4 rows with 10 in each row and came up perfectly centerd, i have here included both codes, can someone se why it wont center when i change the limit in the mysql query from 40 to 24 and and change so it's 7 images per row in 4 rows, insteed of 10 images per row in 4 rows? :/ MY CODE <? if ($added=="false") { ?><td width="100" align="center"> <a target="_blank" class="add" href="<? echo PROFILE_ADD . $rowsSet['fid']?>"><img class="picture" src="<? echo IMAGE_PATH.$rowsSet['image']?>"</a><br> <a target="_blank" class="add" href="<? echo PROFILE_ADD . $rowsSet['fid']?>"><b>Add</b></a> | <a target="_blank" class="add" href="<? echo PROFILE_VIEW . $rowsSet['fid']?>"><b>View</b></a> <br> <? // echo $rowsSet['dname']?> <? } ?> <? $array = split(",", "$addedusers"); foreach($array as $key => $value) { if (trim($value) == $rowsSet['fid']){ echo '<b><font color="#009900">Added!</font></b>'; } } ?> <br> </td> <? if($counter==7 && $counter1 < mysql_num_rows($resultSet)){ echo "</tr><tr bgcolor='#ffffff'>"; $counter=0; } $counter++; $counter1++; } mysql_free_result($resultSet); ?> </tr> </table> PHP: ORIGINAL CODE <? if ($added=="false") { ?><td width="100" align="center"> <a target="_blank" class="add" href="<? echo PROFILE_ADD . $rowsSet['fid']?>"><img class="picture" src="<? echo IMAGE_PATH.$rowsSet['image']?>"</a><br> <a target="_blank" class="add" href="<? echo PROFILE_ADD . $rowsSet['fid']?>"><b>Add</b></a> | <a target="_blank" class="add" href="<? echo PROFILE_VIEW . $rowsSet['fid']?>"><b>View</b></a> <br> <? // echo $rowsSet['dname']?> <? } ?> <? $array = split(",", "$addedusers"); foreach($array as $key => $value) { if (trim($value) == $rowsSet['fid']){ echo '<b><font color="#009900">Added!</font></b>'; } } ?> <br> </td> <? if($counter==10 && $counter1 < mysql_num_rows($resultSet)){ echo "</tr><tr bgcolor='#ffffff'>"; $counter=0; } $counter++; $counter1++; } mysql_free_result($resultSet); ?> </tr> </table> PHP:
it's easier to separate the php and html code,,, leave the php code in the server site and the html code in the presentation site...
i dunno how that would help me, but here is the HTML code only. <!-- top 12 users --> <table class="top12" cellpadding="2" cellspacing="1" border="0" width="800" bgcolor="#FFFFFF"> <tr bgcolor="#FFFFFF"> <td width="100" align="center"> <a target="_blank" class="add" href="http://GrabSomeAdds.com/adduser.php?user=&id=59637977"><img class="picture" src="http://a522.ac-images.myspacecdn.com/images01/69/m_0cef5ac7bbaecb477d865a92f15e0781.jpg"></a><br> <a target="_blank" class="add" href="http://GrabSomeAdds.com/adduser.php?user=&id=59637977"><b>Add</b></a> | <a target="_blank" class="add" href="http://profile.myspace.com/index.cfm?fuseaction=user.viewprofile&friendid=59637977"><b>View</b></a><br> Points: <strong>0<br></strong> </td> </tr> </table> <!-- top 12 users --><br><br></td> </tr> </table> HTML: