SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Zealot
    Join Date
    Jun 2005
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up Resize Table Column, Text not visible

    Hi Everyone

    I have an odd problem that only occurs in IE(ok, maybe thats not odd). Anyway, I have a table which is styled to render quickly off of the width of the first column.

    Example

    HTML Code:
    <TABLE style = "table-layout:fixed;width:0px;">
        <TR style = "height:16px;">
               <TD  id = "testTD" style = "width:25px;"></TD>
               </TD>
       </TR>
      ...
    </TABLE>
    Now, The column of the table will render at 25px width, no matter what the content is. The idea is that the column can then be resized, as so
    Code:
        var obj = document.getElementById("testTD");
        obj.style.width = parseInt(obj.style.width) + 10;  //Just an example
    The Resizing works great in firefox/Explorer. In explorer, the text is not rerendered to the new width, so although the cell is larger, the amount of data you can see is the same.

    Any suggestions?
    Thanks
    AFrieze

  2. #2
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can you try removing the table-layout:fixed from the styling of the table?


  3. #3
    SitePoint Zealot
    Join Date
    Jun 2005
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nope
    Having that style is what enables the browser to start rendering the table without calculating column widths.
    Andrew

  4. #4
    SitePoint Member
    Join Date
    Apr 2006
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've never had trouble of that sort with IE. However, I have never done anything weird like specify a width of 0 on a table. I suspect this is what is confusing IE.

    You do not have to use table-layout: fixed to get fast table rendering. Setting any width (other than auto) on a column element is the only trigger a browser needs to render the table faster than the default.

  5. #5
    SitePoint Zealot
    Join Date
    Jun 2005
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Bump


Bookmarks

Posting Permissions

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