Jump to content

Recommended Posts

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>
";

?>

Link to comment
https://forums.phpfreaks.com/topic/244168-i-need-some-while-loop-help/
Share on other sites

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;
}

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.