Mar
24
Written by:
Wil Dobson
3/24/2008 11:28 AM
Want your GridView Headers to remain floating atop while scrolling your data? Do it with CSS!
/* Lock the datagrid header when scrolling */
th {
position:relative;
cursor: default;
/*IE5+ only*/
top: expression(this.parentElement.parentElement.parentElement.parentElement.scrollTop);
/*top:<span class='val'> expression(document.getElementById("depositDatagridDiv").scrollTop-<span class='unit'>2</span>)</span>;*/
z-index: 99;
}
/* Keeps the header as the top most item. Important for top left item*/
th.locked { z-index: 200; }
/* end lock the datagrid header when scrolling */
Copyright ©2008 Wil Dobson
Tags: