PDA

View Full Version : Table Dimension Error



Halting
04-07-2006, 06:52 PM
Hi,

I'm using tables and setting their dimensions in percentages. I've got two tables with the same dimensions for each columms yet their output is different:-



case 'inbox':
$get = mysql_query("SELECT * from pmessages where touser = '$logged[username]' order by id desc");
echo("<style type=\"text/css\">
<!--
.style1 {
color: #FFFFFF;
font-weight: bold;
}
-->
</style>
<table width=\"100%\" style=\"border: 2px #000000 solid;\" cellpadding=\"4\" cellspacing=\"0\" bordercolor=\"#000000\" background=\"http://www.habbocentre.com/images/inbox_toolbar$_GET[skin].PNG\" bgcolor=\"#663399\">
<tr>
<td align=\"left\" width=\"50%\" style=\"padding-left: 4px;\"><span class=\"style1\"><img align=\"left\" src=\"http://www.habbocentre.com/images/evn.gif\" border=\"0\" style=\"padding-right: 5px;\"> SUBJECT, AUTHOR & DATE WRITTEN</span></td>
<td align=\"left\" width=\"10%\" style=\"padding-left: 4px;\">k</td>
<td width=\"20%\" align=\"right\" style=\"padding-right: 9px;\"><span class=\"style1\">DELETE <a href=\"javascript:checkedAll('action', true)\" style=\"color: #FFFFFF; font-color: #FFFFFF;\">ALL</a>/<a href=\"javascript:checkedAll('action', false)\" style=\"color: #FFFFFF; font-color: #FFFFFF;\">NONE</a></span></td>
</tr>
</table>");
$nummessages = mysql_num_rows($get);
if ($nummessages == 0)
{
}
else
{
echo("<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">");
while ($messages = mysql_fetch_array($get))
{
echo ("<tr>
<td style=\"padding-top: 4px; padding-left: 4px;\" align=\"left\" width=\"50%\" style=\"padding-left: 5px;\"><a href=\"mail.php?action=view&msgid=$messages[id]&skin=$_GET[skin]\">");
if ($messages[unread] == unread)
{
echo ("<u>");
}
if ($messages[reply] == yes)
{
echo ("RE: ");
}
$getsenderusersql = mysql_query("SELECT * FROM `users` WHERE `username` = '$logged[username]'");
$getsenderuser = mysql_fetch_array($getsenderusersql);
echo ("<b>$messages[title]</b>");
if ($messages[unread] == unread)
{
echo ("</u>");
}
echo ("</a> by <a href=\"http://www.habbocentre.com/members.php?user=$messages[from]\">$messages[from]</a> at $messages[date]</td>
<td align=\"left\" width=\"10%\" style=\"padding-left: 4px;\"><span class=\"style1\">k</span></td>
<td width=\"20%\" align=\"right\" style=\"padding-right: 9px;\"><input type=\"checkbox\" name=\"$messages[id]\" id=\"$messages[id]\" value=\"$messages[id]\" /></td>
</tr>");
}
echo ("<tr><td width=\"80%\"></td><td width=\"20%\" align=\"right\" style=\"padding-top: 5px; padding-right: 9px;\"><input type=\"submit\" name=\"perform\" id=\"perform\" value=\"Delete Selected\" /></td></tr></table>");
if($_POST['perform']) {
foreach($_POST as $id) {
mysql_query("DELETE FROM pmessages WHERE id='$id' LIMIT 1");
}
}
}
break;


My code isn't very clean atm and I do aplogize. I usually finish the page and clean up the code afterwards.

If you know what my problem is or know it's solution, please let me know.

Thanks,
Halting

Want to hide these adverts? Register an account for free!