Jump to content

Recommended Posts

I have a table like:

<table border="0" width="1000" cellpadding="6" cellspacing="5">
<tr>
  <td width="150" rowspan="2" valign="top"><td>
  <td width="650" bgcolor="#212121">Title goes up here!</td>
  <td width="200" bgcolor="#111111" rowspan="2" valign="top"></td>
</tr>
<tr>
  <td width="650" bgcolor="#000000" valign="top">Main page goes here!</td>
</tr></table>

 

The problem is that the title table cell is mean! If the main page cell isn't very full then the title cell enlarges! it takes up half the page. How do I control its height?? I know putting height="X" doesn't work :(

Link to comment
https://forums.phpfreaks.com/topic/63647-table-cell-height/
Share on other sites

Here is an image showing the problem http://www.a3share.com/members/69189/example.jpg You can see that the top cell of the middle column has spread downwards. I have tried taking a different approach with it by changing the background to an image and then stating the height, but no joy :(

 

  <td width="650" background="/images/topbar.png" height="20" valign="top"><center>Title!</center></td>

Link to comment
https://forums.phpfreaks.com/topic/63647-table-cell-height/#findComment-317571
Share on other sites

The whole page?

<?
include 'db.php'; // Connect to DB
$email = $_COOKIE['email']; 
$password = $_COOKIE['password']; 
if((!$email) || (!$password)){ 
echo "Please enter ALL of the information! <br />"; 
include 'index.php'; 
exit(); 
} 
$sql = mysql_query("SELECT * FROM users WHERE email = '$email'");
$mem = mysql_fetch_array($sql);
$link = mysql_query("SELECT * FROM links") or die(mysql_error());
$qlink = mysql_fetch_array($link);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="default.css"> 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Iridia Central</title>
</head>

<body bgcolor=black>
<center>
<?
include 'links.php';
?>
</center>
<table border="1" width="1000" cellpadding="6" cellspacing="5">
<tr>
  <td width="150" rowspan="2" valign="top"><? include 'panel.php'; ?></td>
  <td width="650" background="/images/topbar.png" height="20" valign="top"><center>Iridia Central</center></td>
  <td width="200" bgcolor="#111111" rowspan="2" valign="top"><left><? include 'links2.php'; ?></left></td>
</tr>
<tr>
  <td width="650" bgcolor="#000000" valign="top">

<li><a href=http://www.lordoftheabyss.com/house.php?id=<? echo $mem[id] ?>><? echo $mem[username] ?>'s House</a>
<li><a href=http://www.lordoftheabyss.com/society/index.php>Society Hall</a>
<li><a href=http://www.lordoftheabyss.com/mysociety.php?id=<? echo "$mem[clutch]"; ?>>My Society</a>
<li><a href=http://www.lordoftheabyss.com/market>Market Square</a>
<li><a href=http://www.lordoftheabyss.com/quests/main>Old Man's Hut</a>
<li><a href=http://www.lordoftheabyss.com/hall>Town Hall</a>
<li><a href=http://www.lordoftheabyss.com/>link</a>
<li><a href=http://www.lordoftheabyss.com/>link</a>
<li><a href=http://www.lordoftheabyss.com/>link</a>
<li><a href=http://www.lordoftheabyss.com/>link</a>
<li><a href=http://www.lordoftheabyss.com/>link</a>
<li><a href=http://www.lordoftheabyss.com/>link</a>


</td></tr>
</table>
<center>
<?
include 'links.php';
?>
</center>
</body>
</html>

 

http://www.a3share.com/members/69189/example.jpg that's the image with borders now

Link to comment
https://forums.phpfreaks.com/topic/63647-table-cell-height/#findComment-317600
Share on other sites

Its better looking at the html source code the php script generates. Right click view source in your web browser.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="default.css"> 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Iridia Central</title>
</head>

<body bgcolor=black>
<center>
<br><a href="http://www.lordoftheabyss.com/house.php">Lord of the Abyss's House</a> |
<a href="http://www.lordoftheabyss.com/iridia.php" border="0">Iridia Central</a> |
<a href="http://www.lordoftheabyss.com/society/mysociety.php?id=10">My Society</a> | 
<a href="http://www.lordoftheabyss.com/market/index.php?sort=lowcost" border="0">Market Square</a> |
<a href="http://www.lordoftheabyss.com/battle/index.php" border="0">Battle</a> |
<a href="http://www.lordoftheabyss.com/quests/main/index.php" border="0">Old Man's Hut</a> |
<a href="http://www.lordoftheabyss.com/im/index.php">Instant Message</a> |
<a href="http://www.lordoftheabyss.com/forum/" border="0">Message Board</a> |
<a href="http://www.lordoftheabyss.com/player/find.php" border="0">Find Player</a> |
<a href="http://www.lordoftheabyss.com/account/index.php" border="0">Account Settings</a> |
<a href="http://www.lordoftheabyss.com/logout.php" border="0">Logout</a><br><br></center>
<table border="1" width="1000" cellpadding="6" cellspacing="5">
<tr>
  <td width="150" rowspan="2" valign="top"><table border=0 cellpadding=5><tr><td>
<center><img src=http://www.lordoftheabyss.com/images/icons/male.JPG title=Male>
<img src=http://www.lordoftheabyss.com/images/icons/admin.png title=Administrator>
<img src=http://www.lordoftheabyss.com/images/icons/mod.png title=Moderator>
<img src=http://www.lordoftheabyss.com/images/icons/demon.png title=Demon><br><img src='http://www.lordoftheabyss.com/images/players/default2.jpg'>
<center>
<b>LF:</b> 15 / 15<br>
<div style="background-color:red;height:8px;width:120px;">
<div style="background-color:green;float:left;height:8px;width:100%;"></div></div><br><br>

<b>Exp:</b> 0 / 150<br>
<div style="background-color:red;height:8px;width:120px;">
<div style="background-color:green;float:left;height:8px;width:0%;"></div></div>
</center>
</center></td></tr><tr><td bgcolor=#222222><fieldset><legend><b>Game Time</b></legend> <b>Current Time:</b> 
<br> 07-08-2007 11:08:35<br>
<br></fieldset>
<br><fieldset><legend><b>Stats</b></legend>
 <b>Level:</b> 500<bR>
 <b>Gold:</b> 9,950,000<br>
 <b>Treasures:</b> <br>
 <b>APs:</b> 0<bR>
 <b>Strength:</b> 3.00<br>
 <b>Speed:</b> <bR>
 <b>Stamina:</b> 2.00<br>
 <b>Magic:</b> 1.00<bR>
 <b>Stats:</b> 6<br>

<br></fieldset><br><bR></td></tr>

</table></td>
  <td width="650" background="/images/topbar.png" height="20" valign="top"><center>Iridia Central</center></td>
  <td width="200" bgcolor="#111111" rowspan="2" valign="top"><left><br><a href="http://www.lordoftheabyss.com/house.php">Lord of the Abyss's House</a><br>
<a href="http://www.lordoftheabyss.com/iridia.php" border="0">Iridia Central</a><br>
<a href="http://www.lordoftheabyss.com/society/mysociety.php?id=10">My Society</a><br>
<a href="http://www.lordoftheabyss.com/market/index.php?sort=lowcost">Market Square</a><br>
<a href="http://www.lordoftheabyss.com/battle/index.php" border="0">Battle</a><br>
<a href="http://www.lordoftheabyss.com/quests/main/index.php" border="0">Old Man's Hut</a><br>
<a href="http://www.lordoftheabyss.com/im/index.php">Instant Message</a><br>
<a href="http://www.lordoftheabyss.com/forum/" border="0">Message Board</a><br>
<a href="http://www.lordoftheabyss.com/player/find.php" border="0">Find Player</a><br>
<a href="http://www.lordoftheabyss.com/account/index.php" border="0">Account Settings</a><br>
<a href="http://www.lordoftheabyss.com/logout.php" border="0">Logout</a><br><br></left></td>
</tr>
<tr>
  <td width="650" bgcolor="#000000" valign="top">

<li><a href=http://www.lordoftheabyss.com/house.php?id=1>Lord of the Abyss's House</a>
<li><a href=http://www.lordoftheabyss.com/society/index.php>Society Hall</a>
<li><a href=http://www.lordoftheabyss.com/mysociety.php?id=10>My Society</a>
<li><a href=http://www.lordoftheabyss.com/market>Market Square</a>
<li><a href=http://www.lordoftheabyss.com/quests/main>Old Man's Hut</a>
<li><a href=http://www.lordoftheabyss.com/hall>Town Hall</a>
<li><a href=http://www.lordoftheabyss.com/>link</a>
<li><a href=http://www.lordoftheabyss.com/>link</a>
<li><a href=http://www.lordoftheabyss.com/>link</a>
<li><a href=http://www.lordoftheabyss.com/>link</a>
<li><a href=http://www.lordoftheabyss.com/>link</a>
<li><a href=http://www.lordoftheabyss.com/>link</a>


</td></tr>
</table>
<center>
<br><a href="http://www.lordoftheabyss.com/house.php">Lord of the Abyss's House</a> |
<a href="http://www.lordoftheabyss.com/iridia.php" border="0">Iridia Central</a> |
<a href="http://www.lordoftheabyss.com/society/mysociety.php?id=10">My Society</a> | 
<a href="http://www.lordoftheabyss.com/market/index.php?sort=lowcost" border="0">Market Square</a> |
<a href="http://www.lordoftheabyss.com/battle/index.php" border="0">Battle</a> |
<a href="http://www.lordoftheabyss.com/quests/main/index.php" border="0">Old Man's Hut</a> |
<a href="http://www.lordoftheabyss.com/im/index.php">Instant Message</a> |
<a href="http://www.lordoftheabyss.com/forum/" border="0">Message Board</a> |
<a href="http://www.lordoftheabyss.com/player/find.php" border="0">Find Player</a> |
<a href="http://www.lordoftheabyss.com/account/index.php" border="0">Account Settings</a> |
<a href="http://www.lordoftheabyss.com/logout.php" border="0">Logout</a><br><br></center>
</body>
</html>

 

You could try creating a class for that td cell and setting the height in CSS...that's what I'd do, anyway. =/

 

I've tried that, or I believe I tried what you are implying

Link to comment
https://forums.phpfreaks.com/topic/63647-table-cell-height/#findComment-317789
Share on other sites

Tricky...I played around with it a little, and with this:

 

td.title { height: 0px; vertical-align:top; text-align:center; padding-bottom:0px;}

 

in the style sheet, I was able to make the height go down a little bit, but not all the way. =/

 

Also, you should probably work on being a little more consistent. Such as, including quotes around all your tag values, and making sure everything is lower-case. Goes for your style-sheet too, though I dunno if XHTML takes your style sheet into account (because XHTML shuns capitalization). But still, it'd be easier to follow if everything was consistent.

 

Link to comment
https://forums.phpfreaks.com/topic/63647-table-cell-height/#findComment-317864
Share on other sites

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.