www.webdeveloper.com
Results 1 to 4 of 4

Thread: [RESOLVED] Div overflow: problem with scrollbars in IE7

  1. #1
    Join Date
    Jan 2011
    Posts
    3

    resolved [RESOLVED] Div overflow: problem with scrollbars in IE7

    Hello,

    I got stuck trying to solve a problem with div overflow in IE7.

    I have a div whose content is loaded through an Ajax request.
    The HTML I get through Ajax looks like this:

    HTML Code:
    <div style="padding:10px">
      <div style="width: 95%; height:200px; align: center; overflow-x:hidden; overflow-y:auto">
        <table style="width:100%">
            <!-- Table content - All cells in first column have a checkbox -->
        </table>
      </div>
    </div>
    What I expect is: if the table height is greater than 200px, the vertical scrollbar is shown, and the horizontal scrollbar is always hidden. This works correctly in Firefox and IE6, but it does not work in IE7.

    The result I get in IE7 is: after the div content is reloaded, no scrollbar appears at all. But if I check any of the checkboxes in the first column, the vertical scrollbar appears over part of the column in the right, so I would need to modify horizontal scrollbar visibility only in that case.

    How can I solve this?
    Thanks in advance for your help.

  2. #2
    Join Date
    Jan 2003
    Location
    Dundee, Scotland
    Posts
    1,367
    this is a common problem. Have a read of this article:

    problem with div overflow in IE7

    hope that helps


    regards

    Ribs
    ----------------------------------

  3. #3
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    Quote Originally Posted by Ribeyed View Post
    this is a common problem. Have a read of this article:

    problem with div overflow in IE7

    hope that helps


    regards

    Ribs
    As there is no link in your post (in fact you inserted the same string as url and text), that is not of much help.

    Maybe this:
    http://snook.ca/archives/html_and_cs...e_overflow_ie/
    will help somehow

    Or this:
    http://remysharp.com/2008/01/21/fixi...rflow-problem/
    Last edited by Kor; 01-27-2011 at 06:57 AM.

  4. #4
    Join Date
    Jan 2011
    Posts
    3

    resolved

    Yes, I found that the link provided by Ribeyed did not work, but I also found this thread that helped me:

    Table in div does not get scrollbars in IE7

    This is something very similar to the first link posted by Kor. The solution I applied is adding position:relative to the container div and position:absolute to the table. After this, I only needed a minor table width adjustment to make it completely visible in IE7, but that's all. It works perfectly with Firefox.

    Thanks a lot to both, Ribeyed and Kor, for your help.
    Regards,

    -- no music, no life --

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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