Tables... help!

admin

Administrator
Staff member
Anyone see what's wrong with this code?<br />
<br />
----------------------------<br />
<html><br />
<head><br />
<title>Untitled</title><br />
<link rel="stylesheet" href=http://www.webdeveloper.com/forum/archive/index.php/"style.css" type="text/css"><br />
</head><br />
<body><br />
<div style="position: absolute; top: 0px; left: 0px; width: 150px;"><br />
<table width="150" border="0" cellpadding="0" cellspacing="0"><br />
<tr><br />
<td><img src=http://www.webdeveloper.com/forum/archive/index.php/"mnav.png" width="150" height="11"><br />
</td><br />
</tr><br />
<tr><br />
<td><center><span class="text">Main<br>Links<br>Contact</span></center><br />
</td><br />
</tr><br />
</table><br />
</div><br />
</body><br />
</html><br />
<br />
-------------------------------<br />
NOTE: The title I'm going to change, and I know I don't have a doctype specified, but I don't usually insert those until I have a so-called "base" layout down, then I correct stuff.<br />
<br />
The problems I'm having are...<br />
1) It's not starting at 0x0, it's all the way to the left, but starts a few px down from the top.<br />
2) It seems like there's a massive cellspacing, because between that image and the TD placed below it, there's a HUGE gap.<br />
<br />
Any help would be appreciated.<br />
<br />
Thanks!<!--content-->Nothing!<br />
If you put a border="1" in the table You will see that it is at the top. What you see is the image border.<!--content-->Originally posted by NeueZiel <br />
Anyone see what's wrong with this code?<br />
<br />
<br />
I would say that you are using a <table> at all. Why on earth are you doing that in the first place?<br />
<br />
Try this instead<br />
<br />
<div style="position: absolute; top: 0px; left: 0px; width: 150px; text-align:center;"><br />
<img src=http://www.webdeveloper.com/forum/archive/index.php/"mnav.png" width="150" height="11"><br />
<div class="text">Main<br>Links<br>Contact</div><br />
</div><!--content-->With border=0 the border should be eliminated entirely... I've gotten that to work before.<br />
<br />
And Stefan, with the way you posted about doing it, could I keep adding images and such just doing <BR> between each line, or would I have to do something else?<br />
<br />
EDIT: The way you posted didn't work. I'll try to be more descriptive.. The text is working fine, but around the image (top and bottom only), there's a spacing of a few px..<br />
<br />
I would post a URL, but seeing as I'm running this locally, that's not possible.<br />
<br />
SECOND EDIT: I got it fixed... all that was wrong was that it wanted a <BR> right after the image... Thanks for the help!<!--content-->Originally posted by NeueZiel <br />
The text is working fine, but around the image (top and bottom only), there's a spacing of a few px..<br />
<br />
<br />
JFYI, if you are setting a Gecko browser into standards compatible parsing mode (by using a compleate and correct STRICT doctype as you should) you can also get a a few px spacing between images.<br />
<br />
This depends on that text by default is {vertical-align:baseline} and images are handled the same as text. To get rid of the space you have to position the image {vertical-align:bottom}.<!--content-->
 
Top