samedi 11 juin 2016

Text on side of table

I've tried a thousand times to try to get the text right vedsiden of the edge, as shown below.

Screenshot

But when it reaches the maximum limit of characters goes down like this:

Screenshot

The text comes there will not move below that area untakk that it can go down as far as it is the case.

<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<!--[if IE]>
  <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<style>
  table {
    float:left;
    background:yellow;
    margin-left:10px;
  }
</style>
</head>
<head>
<script>

</head>
</script>
<?
include("core.php");
$style='<style type="text/css">
    table.ekstra{
        width:200px;
    }
</style>
';
    startpage("Profil");
?>
<?php
if(!isset($_GET['id'])){
echo '
<p>Denne profilen kan ikke vises. Vennligst søk på en spiller for å se profilen. Søkefunksjonen kommer så snart profilscriptet er klart.</p>
';
}

else if(isset($_GET['id'])){
//Profilen fungerer
$id = $db->escape($_GET['id']);
if(!is_numeric($id)){
echo '
<p class="feil">Denne id-en er ikke godkjent!</p>
';
}
else{
$profil = $db->query("SELECT * FROM `users` WHERE `id` = '$id' LIMIT 1");
if($db->num_rows() == 1){
$fetch = $db->fetch_object($profil);
$timeuser = time() - $fetch->lastactive;
list($ranknr,$ranknm,$exper) = rank($fetch->exp);
unset($ranknr);
if(r1()){
$experience = "({$fetch->exp})";
}
if($fetch->image == NULL || $fetch->image == ''){
$image = "imgs/nopic.png";
}
else{
$image = htmlentities(filter_var($fetch->image, FILTER_SANITIZE_URL));
}
$regd = ($fetch->regdato != 0) ? date("H:i:s | d-m-Y",$fetch->regdato) : '<em>Ukjent registreringsdato</em>';
$var = array(1=>"<span class='stat1' title='Admin'>Admin</span>",2=>"<span class='stat2' title='Moderator'>Moderator</span>",3=>"<span class='stat3' title='Forum moderator'>Forum Moderator</span>",4=>rainbow("Picmaker"),5=>"<span class='stat5' title='Vanlig spiller'>Vanlig spiller</span>",6=>"<span class='stat6' title='Død'>Død</span>");
$status = $var[$fetch->status];
if($fetch->health == 0){
$status = '<span style="color:#ff0000">Død</span>';
}
$ute = number_format($fetch->hand);
$sendtmld = number_format($fetch->sendtmld);
if($sendtmld == 0){$sendtmld = 'Ingen meldinger sendt';}
$lasttime = ($fetch->lastactive == 0) ? "Ingen aktivitet siden registrering!" : date("H:i:s | d-m-Y",$fetch->lastactive);
$db->query("SELECT CHAR_LENGTH(`note`) as `lengde`,`note` FROM `users` WHERE `id` = '$fetch->id' LIMIT 1;");
$res = $db->fetch_object();
$havenote= ($res->lengde >= 1) ? 1:0;
$exbut= (r1() || r2()) ? '<a class="button" href="profil.php?id='.$fetch->id.'&note">Se notater p&aring; bruker!('.$havenote.')</a>' : NULL;
$familie = famidtoname($fetch->family,1);
if($fetch->family == null){$familie = "<i>ingen</i>";}else{$familie = famidtoname($fetch->family,1);}
if(isset($_GET['note'])){
/*Vis notat på bruker*/
  if(isset($_POST['norte'])){
$id = $db->escape($_POST['norte']);
$db->query("UPDATE `users` SET `note` = '".$db->escape($_POST['norte'])."' WHERE `id` = '".$fetch->id."' LIMIT 1");
$db->query("UPDATE `users` SET `noteav` = '".$obj->user."' WHERE `id` = '".$fetch->id."' LIMIT 1");
lykket("Notatene ble oppdatert!");
  $fetch->note = htmlentities($_POST['norte'],NULL,"ISO-8859-1");
}
else{
echo "<p class="feil">Hold det så kort som mulig, unngå enter og lang tekst.</br></p>";
}
echo '<form method="post" action=""><textarea style="height:140px; width:730px;" name="norte">'.($fetch->note).'</textarea><input type="submit" value="Lagre"></form>';
}
if(r1() || r2()){

}           
echo "
<table style="width:300px;margin-top: 20px;" class="table ekstra">
<tr>
</tr>
<tr>
<td style="text-align:center;" colspan="2" class="img"><img src="{$image}" style="width:250px;height:250px;text-align:center"></td>
</tr>
<tr><th colspan="2">Om</th></tr>
<tr>
<td>Brukernavn:</td><td>{$fetch->user}</td>
</tr>
<tr>
<td>Status:</td><td><b>{$online}</b></td>
</tr>
<tr>
<td>Sist Aktiv:</td><td><span id="usertime"></span></td>
</tr>
<tr>
<td>Registrert:</td><td>{$regd}</td>
</tr>

<tr>
<td>Rank:</td><td>{$ranknm}</td>
</tr>
<!--<tr>
<td>Pengerank:</td><td>Venter på sql</td>-->
</tr>
<tr>
<td>Familie:</td><td>$familie</td>
</tr>
"; 
if(r1() || r2()){
  $db->query("SELECT `user_agent` FROM `sessusr` WHERE `uid` = '{$fetch->id}' ORDER BY `id` DESC LIMIT 1");
  if($db->num_rows() == 1){
    $desuyo=$db->fetch_object();
    $harikke=$desuyo->user_agent;
  }
  else{
    $harikke="Har ikke logget inn enda.";
  }
  $harikke=($obj->status > 1 && $fetch->status == 1) ? "***" : $harikke;
echo '<tr><th colspan="2">Moderator & Admin info</th></tr><tr>
<td>Mail:</td><td>'.$fetch->mail.'</td></tr>
<tr><td>By:</td><td>'.  city($fetch->city).'</td></tr>
<tr><td>Bank:</td><td>'.number_format($fetch->bank).' kr</td></tr>
<tr><td>Helse:</td><td>'.$fetch->health.'%</td></tr>
<tr><td>Kuler:</td><td>'.$fetch->bullets.'</td></tr>
<tr><td>Poeng:</td><td>'.$fetch->points.'</td></tr>
<tr><td>Oppført IP:</td><td>'.(($obj->status > 1) ? "***" : (($fetch->regip != NULL) ? $fetch->regip : "<i>Ikke registrert</i>")).'</td></tr>
<tr><td>Sist brukte IP:</td><td>'.(($obj->status > 1) ? "***" : (($fetch->ip != NULL) ? $fetch->ip : "<i>Ikke registrert</i>")).'</td></tr>
<tr><td>Oppført hostname:</td><td>'.(($obj->status > 1) ? "***" : (($fetch->reghostname != NULL) ? $fetch->reghostname : "<i>Ikke registrert</i>")).'</td></tr>
<tr><td>Siste hostname:</td><td>'.(($obj->status > 1) ? "***" : (($fetch->hostname != NULL) ? $fetch->hostname : "<i>Ikke registrert</i>")).'</td></tr><tr>
</tr>
';

}
echo "
</table>
<table style="width:300px;margin-top: 20px;" class="table ekstra">
<br />
<div class="profiltekst">
";
$profil = bbcodes($fetch->profile,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0);
echo $profil;
echo '
</div>
<script type="text/javascript">
teller('.$timeuser.','usertime',false,'opp');
</script>
';
}
else{
echo '
<p class="feil">Det var ikke funnet noen bruker med id: '.htmlentities($id).'! Bruk søkefunksjonen <a href="finnspiller.php">Finn spiller</a> for å finne spillere.</p>
';
}
}
}

?>
</table>
<?php
endpage();
?>

Aucun commentaire:

Enregistrer un commentaire