468,238 Members | 2,047 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,238 developers. It's quick & easy.

IE Pixel discrepancy with top / scrollTop

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
1 9693
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.

Similar topics

1 post views Thread by Csaba Gabor | last post: by
2 posts views Thread by Axel Schick | last post: by
9 posts views Thread by Andy | last post: by
30 posts views Thread by Chaos | last post: by
2 posts views Thread by =?Utf-8?B?SGFyZHkgV2FuZw==?= | last post: by
1 post views Thread by ofiras | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.