Hello,
I have a small problem that I cannot deal with - how can I alignment the $exp to the right in powergamers box? It's sticked next to the names, but I don't want to..
Powergamers code that I use:
I have a small problem that I cannot deal with - how can I alignment the $exp to the right in powergamers box? It's sticked next to the names, but I don't want to..
Powergamers code that I use:
Code:
<?php
$powergamers = $SQL->query("SELECT name, experience, exphist_lastexp FROM players WHERE group_id < 2 ORDER BY experience - exphist_lastexp DESC LIMIT 5;");
?>
<div class="col-3 pull-right">
<div class="well">
<tbody><div class='bg'>
<?php
foreach($powergamers->fetchAll() as $player) {
$exp = ($player['experience']-$player['exphist_lastexp']) / 1000;
$name = $player['name'];
if (strlen($name) > 10)
{$name = substr($name, 0, 9) . '..';}
echo '
<ul>
<li><a href="?subtopic=characters&name=' . $player['name'] . '">' . $name . '</a> <span class="label label-' . ($exp >= 0 ? 'success' : 'error') . ' pull-right">' . ($exp >= 0 ? '+' : '-') . round($exp) . 'k</span></li>
</ul>
';
}
?>