www.webdeveloper.com
Results 1 to 4 of 4

Thread: <TD> width % works in Firefox but not IE

  1. #1
    Join Date
    Nov 2004
    Location
    Singapore
    Posts
    84

    <TD> width % works in Firefox but not IE

    Hi All,

    I have the following stylesheet setup and the column width of <TD> works well in Firefox but not IE. The left hand panel is narrower than the right hand ones and I do not have excessive long text or whatsoever at the right hand panel. Any idea?


    <STYLE section>
    .blankLineLeft {
    border:0px;
    width:49%;
    height: 20px;
    }

    .blankLineMiddle {
    border:0px;
    width:2%;
    height: 20px;
    }

    .blankLineRight {
    border:0px;
    width:49%;
    height: 20px;
    }


    <HTML section>
    <TR>
    <TD colspan=3 class=blankLineLeft>
    </TD>
    <TD class=blankLineMiddle>
    </TD>
    <TD colspan=2 class=blankLineRight>
    </TD>
    </TR>

  2. #2
    Join Date
    May 2008
    Posts
    381
    What about cellpadding/cellspacing in your HTML section or margins and padding in your CSS? If you have any of those, then your widths won't quite work. Other than that, have you considered playing with your widths to figure out if IE's simply making a miscalculation?

  3. #3
    Join Date
    Nov 2004
    Location
    Singapore
    Posts
    84

    Td

    No cellpadding or cellspacing whatsoever, after I tried, fixed width works but since that's not what I am looking for, fixed width won't do.

    Just wonder why things work in Firefox but not in IE.

  4. #4
    Join Date
    Apr 2006
    Location
    Houston
    Posts
    1,374
    I expect there is some default padding or spacing being applied

    IE and Firefox both treat CSS widths differently. One excludes margins and paddings from the width and one includes it (I've forgotten which one does which - but it is a real pain)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles