By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,787 Members | 1,124 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,787 IT Pros & Developers. It's quick & easy.

IE Pixel discrepancy with top / scrollTop

P: n/a
In the following (IE only) mini page (a table which is supposed
to have a fixed header), when you first do anything with the scroll
bar, you will see the top two rows of the table jump slightly
(a few pixels) down and to the right. I could figure out
a specific numeric fudge factor value that will make me happy
on my own Win 2K / IE 6 system, but I'd like to know a proper
way to make this more general (for other IEs).

Thanks,
Csaba Gabor
<BODY>
<DIV style='width:4in;border:pink 1 solid'>
Notice that the first time you use the scroll bar, the
header position (top two rows) jumps a few pixels
down and to the right. How do I properly correct that?
</DIV><BR>

<DIV style='height:1.5in;border:green 1 solid;overflow:auto'>
<TABLE border=1 id=lowerTable border=0
style='border:blue 1 solid;background-color:yellow'>

<THEAD style='color:white;background-color:purple'>
<TR style='position:relative'
style='top:expression(this.offsetParent.scrollTop) '>
<TH colspan=3>Sample table</TH></TR>
<TR style='position:relative'
style='top:expression(this.offsetParent.scrollTop) '>
<TH>This</TH><TH>is the</TH>
<TH>header row</TH></TR></THEAD>

<TR><TD>Row One</TD><TD>0</TD><TD>1</TD></TR>
<TR><TD>2</TD><TD>Row Two</TD><TD>3</TD></TR>
<TR><TD>4</TD><TD>5</TD><TD>Row Three</TD></TR>
<TR><TD>6</TD><TD>7</TD><TD>Row Four</TD></TR>
<TR><TD>8</TD><TD>Row Five</TD><TD>9</TD></TR>
<TR><TD>Row Six</TD><TD>10</TD><TD>11</TD></TR>
<TR><TD>Row Seven</TD><TD>12</TD><TD>13</TD></TR>
<TR><TD>14</TD><TD>Row Eight</TD><TD>15</TD></TR>
<TR><TD>16</TD><TD>17</TD><TD>Row Nine</TD></TR>
</TABLE>
</BODY>
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Ivo
"Csaba Gabor" <ne**@CsabaGabor.com> wrote in message
news:40******@andromeda.datanet.hu...
In the following (IE only) mini page (a table which is supposed
to have a fixed header), when you first do anything with the scroll
bar, you will see the top two rows of the table jump slightly
(a few pixels) down and to the right. I could figure out
a specific numeric fudge factor value that will make me happy
on my own Win 2K / IE 6 system, but I'd like to know a proper
way to make this more general (for other IEs).

Thanks,
Csaba Gabor
<snip code>
<TR style='position:relative'
style='top:expression(this.offsetParent.scrollTop) '>


Changing this line to

<tr style='top:expression(this.scrollTop)'>

works fine in my WinMe/IE6 browser.
Even better, setting the style of the THEAD element allows me to remove
these definitions from all TR's inside it.

HTH
Ivo
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.