Ask Felgall Home page
Your host:
Stephen Chapman
Stephen Chapman

Filling a Table Cell

Question: Hey man, I accidently found your website and I am amazed of how much information you have on it, great job. Now this is my question: Is there any way to make a square or rectangular image fit the whole area of a cell (<td>) without leaving that thin (normally of 2px) space at the bottom of the cell? I tried using the image as a background of that cell and it works, but I have problems when I want that image to link somewhere else.
anonymous

Answer: Simplest way is to make sure the table defines cellpadding="0" and to make sure there is no space between the > that ends the image tag and the < that starts the </td>

The alternative is to use a stylesheet command to set:

img {display:block}

Related Articles

go to top

FaceBook Follow
Twitter Follow
Donate
Copyright © Felgall Pty Ltd