Freeze Header Row

B

Ben

I have some code I use in ASP to freeze a tables header row. Works
good in ASP. But if I do the same in a .NET 2.0 page, the result is
different -- the header column is show in its entirety instead of
being cut-off by the width of the DIV it's in. You can see my sample
code below... any idea why it's behaving differently ?


<div style="background-color:blush:ffwhite;overflow:auto; width: 100%;
height: 400px;border-left: 1px gray solid; border-top: 1px lightgrey
solid; padding:0px; margin: 0px">
<center style="font-size: 10px; font-family: Arial">

<table id="tblClients" border="0">
<tr
style="position:relative;top:expression(this.offsetParent.scrollTop);">
<th>ComputerName</th><th>SIMSVersion</th><th>OSUpTimeInHours</
th><th>ClientUpTimeInHours</th><th>ClientStartTime</th><th>LastUpdate</
th><th>LastMemUsage</th><th>ClientHealth</th><th>ClientHealthDetail</
th><th>LastFullScanRequestDate</th><th>LastFullScanSent</
th><th>LastFullScanLoad</th><th>FileCount</th><th>IsLoadInProcess</
th><th>ClientGUID</th>
</tr>
</table></center>
</div>
 
B

Ben

I have some code I use in ASP to freeze a tables header row. Works
good in ASP. But if I do the same in a .NET 2.0 page, the result is
different -- the header column is show in its entirety instead of
being cut-off by the width of the DIV it's in. You can see my sample
code below... any idea why it's behaving differently ?

<div style="background-color:blush:ffwhite;overflow:auto; width: 100%;
height: 400px;border-left: 1px gray solid; border-top: 1px lightgrey
solid; padding:0px; margin: 0px">
<center style="font-size: 10px; font-family: Arial">

<table id="tblClients" border="0">
<tr
style="position:relative;top:expression(this.offsetParent.scrollTop);">
<th>ComputerName</th><th>SIMSVersion</th><th>OSUpTimeInHours</
th><th>ClientUpTimeInHours</th><th>ClientStartTime</th><th>LastUpdate</
th><th>LastMemUsage</th><th>ClientHealth</th><th>ClientHealthDetail</
th><th>LastFullScanRequestDate</th><th>LastFullScanSent</
th><th>LastFullScanLoad</th><th>FileCount</th><th>IsLoadInProcess</
th><th>ClientGUID</th>
</tr>
</table></center>
</div>

i don't know if i explained myself right... in more simple terms, if I
have a table in a DIV, and I make a row have a position=relative, that
row does not appear to be contained inside the DIV anymore... if you
scroll the DIV horizontally the row with 'relative' position does not
move.

this only happens to me on an aspx page... on asp it works ok.

can anyone offer tips ? I'm sure .NET has some ability to show a
frozen header row (while maintaining horizontal scrolling ability).
 
B

Ben

i don't know if i explained myself right... in more simple terms, if I
have a table in a DIV, and I make a row have a position=relative, that
row does not appear to be contained inside the DIV anymore... if you
scroll the DIV horizontally the row with 'relative' position does not
move.

this only happens to me on an aspx page... on asp it works ok.

can anyone offer tips ? I'm sure .NET has some ability to show a
frozen header row (while maintaining horizontal scrolling ability).- Hide quoted text -

- Show quoted text -

Cool, i found the solution... if you make the DIV have
position=relative as well, it works as it did in ASP.... sweet !
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top