92 users online (0 members and 92 guests)  


  Results 1 to 6 of 6

Related

  1. Problem in tags    Forum: PHP Forum
    Replies: 8
  2. Replies: 0
  3. scrollable, stationary table    Forum: HTML Forum
    Replies: 2
  4. Table tags    Forum: HTML Forum
    Replies: 1
  1. #1
    bakwasscoder's Avatar
    New User

    Status
    Offline
    Join Date
    Mar 2009
    Posts
    2

    problem in scrollable table by <div> tags

    Hi
    After reading from the thread http://www.ahfb2000.com/webmaster_help_desk/showthread.php?t=849,I was able to make my table scrollable ,but there 2 problems lingering still:
    1.i have to fix the pixel size in div tag like :
    <div align = "left" style="width:1000px; height:400px; overflow:scroll; border:0px;">
    <table align ="left"><tr> <td id = "divHolder"> </td > </tr>
    </table>
    But i am putting data dynamically into table so sometimes scrolls formed are larger than what i needs

    2.On different terminal with different resolution, the table may take less/more space and thus waste/consume the space

    So all in all ,i want to free myself of pixel dependency and move to table contents dependency
    really expecting help from this wonderful forum ,blessed in having great expets!!

  2. #2
    jthayne's Avatar

    Status
    Offline
    Join Date
    Aug 2008
    Location
    Texas
    Posts
    508

    Re: problem in scrollable table by <div> tags

    Try using max-height instead. So change the code you posted to:

    Code:
    <div align = "left" style="width:1000px; max-height:400px; height: expression(this.height > 400 ? 400 : true); overflow:auto; border:0px;">
    <table align ="left"><tr> <td id = "divHolder"> </td > </tr>
    </table>
    </div>

  3. #3
    bakwasscoder's Avatar
    New User

    Status
    Offline
    Join Date
    Mar 2009
    Posts
    2

    Re: problem in scrollable table by <div> tags

    Hey Boss
    Its working!!!The size of scroll is changing as per the table size as what i wanted(in Mozilla).But it doesn't seem to work in IE,where vertical scroll being formed is very long and doesn't fit in one screen.Yours help needed again!!
    Thnx

  4. #4
    jthayne's Avatar

    Status
    Offline
    Join Date
    Aug 2008
    Location
    Texas
    Posts
    508

    Re: problem in scrollable table by <div> tags

    Please either post your code or post a link to the page you are working on.

  5. #5
    markei's Avatar
    New User

    Status
    Offline
    Join Date
    Mar 2009
    Location
    Westminster, MD
    Posts
    19

    Thumbs up Re: problem in scrollable table by <div> tags

    Quote Originally Posted by jthayne View Post
    Try using max-height instead. So change the code you posted to:

    Code:
    <div align = "left" style="width:1000px; max-height:400px; height: expression(this.height > 400 ? 400 : true); overflow:auto; border:0px;">
    <table align ="left"><tr> <td id = "divHolder"> </td > </tr>
    </table>
    </div>
    jthayne:
    Your solution was correct EXCEPT I couldn't get the javascript expression to evaluate correctlyin IE(so the box just got bigger and bigger with no scrollbar). Finally, after much chagrin, searching and staring at it blankly, I tried changing height in your expression to clientHeight and it not only works on IE but both IE and Firefox, although it probably broke some other browser's implementation of Javascript, but that's really not my forte... lol
    so, ...final code:
    Code:
    <div align = "left" style="width:1000px; max-height:400px; height: expression(this.clientHeight > 400 ? 400 : true); overflow:auto; border:0px;">
    <table align ="left"><tr> <td id = "divHolder"> </td > </tr>
    </table>
    </div>
    Last edited by markei; 03-13-2009 at 10:16 PM.

  6. #6
    jthayne's Avatar

    Status
    Offline
    Join Date
    Aug 2008
    Location
    Texas
    Posts
    508

    Re: problem in scrollable table by <div> tags

    Glad to hear it is working, and a big thank you for posting the solution.



Tags for this Thread