Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2008-06-12
4
Medium Priority
?
243 Views
Last Modified: 2013-12-08
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.
0
Comment
Question by:ctangent
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 10

Accepted Solution

by:
bluefezteam earned 2000 total points
ID: 21771853
sounds like there may be whitespace in your code, make sure in the HTML code where your image is, theres no line break or space between the tablecell
Like this
<td><img src="image.jpg" /></td>


as this...
<td><img src="image.jpg" /> </td>
or
<td>
<img src="image.jpg" />
</td>

can produce gaps in IE.
0
 
LVL 10

Expert Comment

by:bluefezteam
ID: 21771876
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;
}
0
 
LVL 4

Expert Comment

by:sajay_j
ID: 21776173
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

0
 
LVL 10

Expert Comment

by:bluefezteam
ID: 21776668
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
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.
Suggested Courses

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question