Link to home
Create AccountLog in
Avatar of ctangent
ctangent

asked on

How do I fix bottom alignment of an image in a table cell in IE?

I have an image in a table cell I want to align to the very bottom. But in IE 7, there is a single line of the background color that appears underneath the image - it is 1 pixel away. I've set margin-bottom, padding-bottom on image and vertical-align:bottom on cell but still doesn't work .Cell padding/spacing is 0 on table.
ASKER CERTIFIED SOLUTION
Avatar of bluefezteam
bluefezteam

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of bluefezteam
bluefezteam

just make sure all the code is flush to each other, no spaces where one tag ends and another meets.

you could also set on the table cell in question the following css and html to make the image gravitate to the end of that cell

<td class="test"></td>

.test {
position:relative;
height:100px; //set to what you need
}

.test img{
position:absolute;
bottom:0;
}
This seems to have a spacing [ &nbsp; ] in your code. or your have a <p> tag or <h1> tag with that images. Please remove any paragraph or header tag around image tag.

your html should look like below;
<table>
<tr>
<td>
<img src="" /> // There should be no other tags around this line....
</td>
</tr>
</table>

Open in new window

actually, I wouldn't have any space around the image tag, even a new line as shown in sajay_j example can create gaps. Try the first method I've shown - good luck