exzrael
09-07-2007, 04:22 AM
http://img377.imageshack.us/img377/1769/snap021al0.jpg (http://imageshack.us)
This is surely a pretty simple issues, but I can't get it to work.
Below each name in the image above I would like to show a comment in grey (<?=$row[5]?>) color to the left, direcly below the name.
Could this be done without mixing up everything else in the table? The images are floating right
PHP-code to show whats seen on the image above
<table id="mytable" cellspacing="0" summary="Länklistan">
<caption><a href=#>Cookies</a> - <a href="ny.php">Ny länk</caption>
<tr>
<th scope="col" abbr="Configurations" class="nobg">Inskickade länkar</th>
<th scope="col" abbr="Namn">Namn</th>
<th scope="col" abbr="Länk">Länk</th>
<th scope="col" abbr="Tipsare">Tipsare</th>
</tr>
<?
$con = mysql_connect(DBHOST,DBUSER,DBPWD);
mysql_select_db(DBDB);
$query = "SELECT *
From tips
WHERE cat = 1
ORDER BY nar DESC";
$result = mysql_query($query);
while ($row = mysql_fetch_row($result))
{
if ($row[2] == "1")
$bild = "images/book_open.png";
elseif ($row[2] == "2")
$bild = "images/camera.png";
elseif ($row[2] == "3")
$bild = "images/film.png";
elseif ($row[2] == "4")
$bild = "images/music.png";
else
$bild = "images/application_xp.png";
?>
<tr>
<th scope="row" class="spec"><?=$row[1]?></th>
<td><a href="comments.php?id=<?=$row[0]?>"><img src="images/comment.png" alt="Kommentarer" align="right"></a> <img src="<?=$bild?>" alt="Länktyp" align="right"><?=$row[3]?></td>
<td><a href="<?=$row[4]?>">Klicka här</a></td>
<td><?=$row[5]?></td>
</tr>
<? } ?>
CSS-code
body {
font: normal 11px auto "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
color: #4f6b72;
background: #E6EAE9;
}
a {
color: #c75f3e;
}
img {
border: 0;
}
#mytable {
width: 700px;
padding: 0;
margin: 0;
}
caption {
padding: 0 0 5px 0;
width: 700px;
font: italic 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
text-align: right;
}
th {
font: bold 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
color: #4f6b72;
border-right: 1px solid #C1DAD7;
border-bottom: 1px solid #C1DAD7;
border-top: 1px solid #C1DAD7;
letter-spacing: 2px;
text-transform: uppercase;
text-align: left;
padding: 6px 6px 6px 12px;
background: #CAE8EA url(images/bg_header.jpg) no-repeat;
}
th.nobg {
border-top: 0;
border-left: 0;
border-right: 1px solid #C1DAD7;
background: none;
}
td {
font: bold 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
border-right: 1px solid #C1DAD7;
border-bottom: 1px solid #C1DAD7;
background: #fff;
padding: 6px 6px 6px 12px;
color: #4f6b72;
}
td.alt {
background: #F5FAFA;
color: #797268;
}
th.spec {
border-left: 1px solid #C1DAD7;
border-top: 0;
background: #fff url(images/bullet1.gif) no-repeat;
font: bold 10px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
}
th.specalt {
border-left: 1px solid #C1DAD7;
border-top: 0;
background: #f5fafa url(images/bullet2.gif) no-repeat;
font: bold 10px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
color: #797268;
}
div#forms {
width: 100px;
}
This is surely a pretty simple issues, but I can't get it to work.
Below each name in the image above I would like to show a comment in grey (<?=$row[5]?>) color to the left, direcly below the name.
Could this be done without mixing up everything else in the table? The images are floating right
PHP-code to show whats seen on the image above
<table id="mytable" cellspacing="0" summary="Länklistan">
<caption><a href=#>Cookies</a> - <a href="ny.php">Ny länk</caption>
<tr>
<th scope="col" abbr="Configurations" class="nobg">Inskickade länkar</th>
<th scope="col" abbr="Namn">Namn</th>
<th scope="col" abbr="Länk">Länk</th>
<th scope="col" abbr="Tipsare">Tipsare</th>
</tr>
<?
$con = mysql_connect(DBHOST,DBUSER,DBPWD);
mysql_select_db(DBDB);
$query = "SELECT *
From tips
WHERE cat = 1
ORDER BY nar DESC";
$result = mysql_query($query);
while ($row = mysql_fetch_row($result))
{
if ($row[2] == "1")
$bild = "images/book_open.png";
elseif ($row[2] == "2")
$bild = "images/camera.png";
elseif ($row[2] == "3")
$bild = "images/film.png";
elseif ($row[2] == "4")
$bild = "images/music.png";
else
$bild = "images/application_xp.png";
?>
<tr>
<th scope="row" class="spec"><?=$row[1]?></th>
<td><a href="comments.php?id=<?=$row[0]?>"><img src="images/comment.png" alt="Kommentarer" align="right"></a> <img src="<?=$bild?>" alt="Länktyp" align="right"><?=$row[3]?></td>
<td><a href="<?=$row[4]?>">Klicka här</a></td>
<td><?=$row[5]?></td>
</tr>
<? } ?>
CSS-code
body {
font: normal 11px auto "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
color: #4f6b72;
background: #E6EAE9;
}
a {
color: #c75f3e;
}
img {
border: 0;
}
#mytable {
width: 700px;
padding: 0;
margin: 0;
}
caption {
padding: 0 0 5px 0;
width: 700px;
font: italic 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
text-align: right;
}
th {
font: bold 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
color: #4f6b72;
border-right: 1px solid #C1DAD7;
border-bottom: 1px solid #C1DAD7;
border-top: 1px solid #C1DAD7;
letter-spacing: 2px;
text-transform: uppercase;
text-align: left;
padding: 6px 6px 6px 12px;
background: #CAE8EA url(images/bg_header.jpg) no-repeat;
}
th.nobg {
border-top: 0;
border-left: 0;
border-right: 1px solid #C1DAD7;
background: none;
}
td {
font: bold 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
border-right: 1px solid #C1DAD7;
border-bottom: 1px solid #C1DAD7;
background: #fff;
padding: 6px 6px 6px 12px;
color: #4f6b72;
}
td.alt {
background: #F5FAFA;
color: #797268;
}
th.spec {
border-left: 1px solid #C1DAD7;
border-top: 0;
background: #fff url(images/bullet1.gif) no-repeat;
font: bold 10px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
}
th.specalt {
border-left: 1px solid #C1DAD7;
border-top: 0;
background: #f5fafa url(images/bullet2.gif) no-repeat;
font: bold 10px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
color: #797268;
}
div#forms {
width: 100px;
}