Get your CodeRanch badge!*
The moose likes HTML, CSS and JavaScript and the fly likes Same CSS rule for td width works for Firefox, but does not work for IE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Same CSS rule for td width works for Firefox, but does not work for IE" Watch "Same CSS rule for td width works for Firefox, but does not work for IE" New topic
Author

Same CSS rule for td width works for Firefox, but does not work for IE

Kevin manoj
Ranch Hand

Joined: Jul 19, 2002
Posts: 36
I have a table which have 3 columns. The first column is the holder for image (img tag), second column is always space ( ); and the third column is a text link.

I use this table to align the image and text link.

One weird thing is in some lines, td just wrap image well with no margins, no spacing and no padding. But for some other table lines, td is always 10 pixels wider than image width which causes the button alignment issue.

To solve this problem, i create a CSS rule as follow:

td { max-width:20px; width:20px}

20px is the width of the image. This rule works in FireFox3, but does not work for IE6.

Can anyone give me some clues about how to resolve the problem?

Thanks in advance
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
IE6 does not have max-width

set overflow to hidden

issue can be with whitespace, use web developer toolbar for IE to inspect the element.

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Same CSS rule for td width works for Firefox, but does not work for IE
 
Similar Threads
Using checkbox on Spring 2.5 MVC ?
server side includes-not working in linux server
using CSS float attribute makes things 'leak' out of their containers ?
Scrollable Table using DIV in IE7 not working as expected
Vertical alignment issues : vertical-align:middle does not work