Cell padding and small images

windows

Guest
Hi , I have a problem... I want to make a table cell only 1 pixel high and the width to fill the space. I also want to stretch an image to fill the total space of that cell. I thought I had the code right with this:<br />
<br />
<td height="1" width="100%"><br />
<img src=http://www.webdeveloper.com/forum/archive/index.php/"pics/layout/blue_dot.jpg" width="100%" height="100%"><br />
</td><br />
<br />
and although the image stretches to fill the whole cell it makes the cell a lot higher than 1 pixel. I can't figure out what the problem is.<br />
<br />
The image is only 1x1 pixel, by the way, I made sure of that...<br />
<br />
Please help!!<!--content-->make the image height="1"<!--content-->thanks but that didn't seem to work... it did exactly the same thing!<!--content-->make sure in your table tag you have cellpadding="0" if the image width="100%" it will automatically resize the height to match the images width, you if you put in a 1 as a pixil value for the height of the image then the height will not resize to match the width.<!--content-->Here's the code I have now...<br />
<br />
<td bgcolor=#29B6FE height="1" width="100%"><br />
<img src=http://www.webdeveloper.com/forum/archive/index.php/"pics/layout/blue_dot.jpg" width="100%" height="1"><br />
</td><!--content-->But you did make sure the padding is 0 correct?<!--content-->height="1" is not the same as height="1px"<br />
<br />
Don't know if that's the answer, but worth a try.<!--content-->Thanks, I tried the 1px as well (and yes the table cellpadding is set to 0). Nothing seems to work! It's really weird.<br />
<br />
If I take the image out then it snaps back to being the right size, but with the image in it bumps up the height. I just don't get it.<!--content-->1 is actually smaller then 1px... But here is a question are you setting any css margins or anything? Also is this on the web I would like to see it myself because it does not seem to be acting the way it should and it would be worth seeing for myself. If its not please attatch your code. Oh yea and if you are just trying to make a line try using <hr width="100%" color="#000000"></hr><!--content-->If you go to <!-- w --><a class="postlink" href="http://www.theyakshack.co.uk">www.theyakshack.co.uk</a><!-- w --> and in IE go to print preview you can see that the lines around the edge do not appear on the printout. That's because that's the background colour of the cell, not an image.<br />
<br />
What I'm trying to do is stretch an image to fill those lines so that the border will print out as well.<br />
<br />
I know it's not a big deal but it annoys me everytime I print something off!<!--content-->Have you tried adjusting the alignment on the image? Instead of the default, what happens if you add: <div align="center">?<!--content-->That doesn't work either. Check the pic I took of the non-working code (it looks the same for everything I tried):<br />
<br />
<!-- w --><a class="postlink" href="http://www.theyakshack.co.uk/temp/bad.jpg">www.theyakshack.co.uk/temp/bad.jpg</a><!-- w --><!--content-->
 
Back
Top