Results 1 to 5 of 5
  1. #1
    itmani2020 is offline Member
    Join Date
    Jun 2008
    Posts
    23
    Rep Power
    0

    Default Regd the scrollbar in a table in JSP

    Hi,
    I m working in Report generating assignment.
    I want to display a table in a jsp page and i am ablr to do it.
    when the data exceeds window size means i want to use one scroll bar that too i am comfortable.
    The problem i m facing is when i m scroll using the scrollbar my table header also scrolling . i want that table header should be locked and the data in the table should be scroll.

    Can any one give some inputs to overcome this issue ie my table header should be be stable ther it self when i m scrolling the table...


    Thanks in advance,
    Mani

  2. #2
    mtv134 is offline Member
    Join Date
    Aug 2008
    Posts
    22
    Rep Power
    0

    Default

    please provide the source of your jsp
    visit http://www.thejavacode.com
    Muhammad Safwat

  3. #3
    itmani2020 is offline Member
    Join Date
    Jun 2008
    Posts
    23
    Rep Power
    0

    Default Hi i go it....

    <style type="text/css">
    .ScrollTable-container {
    display:table-cell;
    }
    .ScrollTable thead tr {
    position: relative;
    }
    .ScrollTable tbody {
    overflow: auto;
    }
    .ScrollTable tbody tr {
    height: auto;
    }
    .ScrollTable tbody tr td:last-child {
    padding-right: 20px;
    }</style>

    -------------------------------------------------------

    <div class="ScrollTable-container">
    <div class="ScrollTable" style="height: 200px;">
    <table>
    <thead>
    <tr><th colspan="2">Heading</th></tr>
    <tr><th>Column 1</th><th>Column 2</th></tr>
    </thead>
    <tbody style="height: 135px;">
    <tr>
    <td align="left">Label1</td>
    <td align="left">Data1</td>
    </tr>
    <tr>
    <td align="left">Label2</td>
    <td align="left">Data2</td>
    </tr>
    </tbody>
    </table>
    </div>
    </div>

  4. #4
    itmani2020 is offline Member
    Join Date
    Jun 2008
    Posts
    23
    Rep Power
    0

    Default With reference to previous post

    Hi guys,
    With the help of above code i got my table header is fixed durind scroll by scrollbar of the table....
    Thanks,
    Mani

  5. #5
    itmani2020 is offline Member
    Join Date
    Jun 2008
    Posts
    23
    Rep Power
    0

Similar Threads

  1. How to get Integer from table
    By adeeb in forum AWT / Swing
    Replies: 1
    Last Post: 06-10-2008, 11:56 AM
  2. Help Regd MyEclipse
    By worldcup2k7 in forum Eclipse
    Replies: 0
    Last Post: 05-22-2008, 07:08 PM
  3. AWT Table Scrolling
    By albert_kam in forum AWT / Swing
    Replies: 0
    Last Post: 01-03-2008, 11:37 AM
  4. Using java.awt.Scrollbar
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-03-2008, 09:19 AM
  5. Table Help
    By CoOlbOyCoOl in forum NetBeans
    Replies: 1
    Last Post: 05-06-2007, 04:19 PM

Posting Permissions

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