I did it with all CSS. I also found better scrolling body examples than the one 
in the FAQ. If you look at the structure of the table that is output then you 
can figure out the necessary CSS, based on examples. Here is something I worked 
on. I can't guarantee compatibility with all browsers but it gives you a 
starting point. 

<style>
table.displaytag {
        border-width: 1px 1px 1px 1px;
        border-spacing: 0px 0px;
        border-style: outset outset outset outset;
        border-color: black black black black;
        border-collapse: separate;
        /* background-color: black; */
    text-decoration: none;
        width: 100%;
}

table.displaytag th {
        border-width: 1px 1px 1px 1px;
        padding: 3px 3px 3px 3px; 
        border-style: inset inset inset inset;
        border-color: black black black black;
        background-color: #F0F0F0;
}

table.displaytag thead tr {
        position: relative;
        height: 20px;
}

table.displaytag tbody {
        height:311px;
        overflow-x:hidden;
        overflow-y: auto;       
        overflow:scroll; 
}

table.displaytag tbody tr {
        height: auto;
        white-space: nowrap;
}

table.displaytag tbody tr td:last-child {
        padding-right: 20px;
}

table.displaytag tbody td {
        border-width: 1px 1px 1px 1px;
        border-spacing: 0px;
        padding: 3px 3px 3px 3px; 
        border-style: inset inset inset inset;
        border-color: black black black black;
        /* background-color: White; */
        FONT: 9pt/100% Verdana;
        color: Black;
        /* -moz-border-radius: 5px 5px 5px 5px; */
}
</style>

<!--[if IE]>
<style type="text/css">
/* IE Specific Style addition to constrain table from automatically growing in 
height */
div.TableContainer {
 height: 311px; 
 overflow-x:hidden;
 overflow-y:auto;
 border: 1px ridge Black;
}
</style>
<![endif]-->

.
.
.
In the body of the document...

     <table width="500" border="0">
                <tr>
                  <td>
                  <div class="TableContainer">    
                  
          <display:table cellpadding="5" cellspacing="0" 
requestURI="/something.do" name="requestScope.items" id="p" defaultsort="1" 
                class="displaytag">

.
.
.       
        </displaytag>

                  </div>
                  </td>
                 </tr>
      </table>


Randy

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of SourceForge.net
Sent: Monday, January 15, 2007 7:42 PM
To: [EMAIL PROTECTED]
Subject: [displaytag-user] [displaytag - Help] static header and tbody 
styleclass


Read and respond to this message at: 
https://sourceforge.net/forum/message.php?msg_id=4104897
By: surya_vus

I want to make the table header static, where it will not scroll along with
the rest of the body.

The example link provided in the FAQ
http://www.imaputz.com/cssStuff/bigFourVersion.html is for a normal HTML table.
It requires a style class to be set for tbody tag. How do I do this with out
any additional java script?
Or is using java script is the only way to go?

Thanks


______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit: 
https://sourceforge.net/forum/unmonitor.php?forum_id=249318

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
displaytag-user mailing list
displaytag-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/displaytag-user



-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.16.10/626 - Release Date: 1/14/2007 8:29 
PM
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.16.12/630 - Release Date: 1/15/2007 8:28 
PM
 

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
displaytag-user mailing list
displaytag-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/displaytag-user

Reply via email to