iStriide Posted August 8, 2011 Share Posted August 8, 2011 I'm having a problem as you can see here http://www.halobattles.comyr.com/profile.php?player=iStriide, and i'm not sure on how to make it where it just lines up side-by-side. Here's the code: <?php $find_weapons = "SELECT * FROM weapons WHERE Username = '$player' ORDER BY Weapon_Level DESC"; $run_weapons = mysql_query($find_weapons); echo " <div class='weapons-list'> <div class='profile-general-stats-heading'> <h4>Weapons List</h4> </div> "; while($list = mysql_fetch_array($run_weapons)){ $weapon_name = $list['Weapon_Name']; $weapon_image = $list['Weapon_Image']; $weapon_level = $list['Weapon_Level']; echo " <table> <tr> <td align='middle'><img src='$weapon_image'/><br/>$weapon_name<br/>$weapon_level</td> </tr> </table> "; } echo" </div> "; ?> Quote Link to comment https://forums.phpfreaks.com/topic/244168-i-need-some-while-loop-help/ Share on other sites More sharing options...
Techmate Posted August 8, 2011 Share Posted August 8, 2011 You need to edit your css file. Located in the css file is something like below. margin: 0 0 0 50; Play with the numbers till you get it the way you like. Quote Link to comment https://forums.phpfreaks.com/topic/244168-i-need-some-while-loop-help/#findComment-1253937 Share on other sites More sharing options...
MasterACE14 Posted August 8, 2011 Share Posted August 8, 2011 move the <table> and <tr> opening and closing tags outside of the while loop. Quote Link to comment https://forums.phpfreaks.com/topic/244168-i-need-some-while-loop-help/#findComment-1253939 Share on other sites More sharing options...
iStriide Posted August 8, 2011 Author Share Posted August 8, 2011 move the <table> and <tr> opening and closing tags outside of the while loop. I did do that but it still doesn't work. Quote Link to comment https://forums.phpfreaks.com/topic/244168-i-need-some-while-loop-help/#findComment-1253942 Share on other sites More sharing options...
MasterACE14 Posted August 8, 2011 Share Posted August 8, 2011 move the <table> and <tr> opening and closing tags outside of the while loop. I did do that but it still doesn't work. looks like it's working to me, just need to fiddle with the dimensions of the table's <td> tag. Quote Link to comment https://forums.phpfreaks.com/topic/244168-i-need-some-while-loop-help/#findComment-1253957 Share on other sites More sharing options...
Muddy_Funster Posted August 9, 2011 Share Posted August 9, 2011 Your problem is in the css. you have set .profile-general-stats-heading h4{ float: left; font-size: 13px; } because of this you need to add a clear:left or clear:both to your .profile-general-stats table class. : .profile-general-stats table{ width: 98%; clear:left; } Quote Link to comment https://forums.phpfreaks.com/topic/244168-i-need-some-while-loop-help/#findComment-1254875 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.