trq Posted August 6, 2009 Share Posted August 6, 2009 I've got this working perfectly in FF but the footer wont play nice in IE7 (which is my only target, this is an intranet application). The header is also working fine in IE7. Example markup. <div id="actual-list"> <table> <thead> <tr> <td>Heading</td> <tr> </thead> <tbody> <tr> <td>Contents</td> <tr> </tbody> <tfoot> <tr> <td>Footer</td> <tr> </tfoot> </table> </div> Obviously, I have allot more columns and allot more rows. The relevant CSS. screen.css #actual-list table{text-align:left;} #actual-list table thead{background:#70b2e1;font-weight:bold;} #actual-list table tbody{height:600px;overflow-y:auto;overflow-x:hidden;}/*see ie.css for ie fix*/ #actual-list table tfoot{background:#3383bb;font-weight:bold;} ie.css (loaded only when IE is the client) #actual-list{position:relative;height:600px;overflow-y:scroll;overflow-x:hidden;} #actual-list table thead tr{position:absolute;padding:4px;top:expression(this.offsetParent.scrollTop);} #actual-list table tbody{height:auto;padding:4px;} #actual-list table tfoot tr{position:absolute;padding:4px;top:expression(this.offsetParent.scrollBottom);} Presently the header is fixed, while both the tbody and tfooter moves when content overflows. I ideally need the footer to stay in a fixed position as well. This is indeed what happens when I use firefox. Quote Link to comment https://forums.phpfreaks.com/topic/169022-fixed-table-header-footer-scrollable-body/ Share on other sites More sharing options...
TheFilmGod Posted August 6, 2009 Share Posted August 6, 2009 Why are you using a table? Stick the thead, tbody, and tfoot in separate divs. Then use position: fixed; Quote Link to comment https://forums.phpfreaks.com/topic/169022-fixed-table-header-footer-scrollable-body/#findComment-891774 Share on other sites More sharing options...
trq Posted August 6, 2009 Author Share Posted August 6, 2009 Why are you using a table? Because I have massive amounts of tabular data. Stick the thead, tbody, and tfoot in separate divs. Then use position: fixed; That seems to break the table completely, have you a small example? Quote Link to comment https://forums.phpfreaks.com/topic/169022-fixed-table-header-footer-scrollable-body/#findComment-891789 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.