IE Pixel discrepancy with top / scrollTop

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Csaba Gabor

    #1

    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:4i n;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:gre en 1 solid;overflow: auto'>
    <TABLE border=1 id=lowerTable border=0
    style='border:b lue 1 solid;backgroun d-color:yellow'>

    <THEAD style='color:wh ite;background-color:purple'>
    <TR style='position :relative'
    style='top:expr ession(this.off setParent.scrol lTop)'>
    <TH colspan=3>Sampl e table</TH></TR>
    <TR style='position :relative'
    style='top:expr ession(this.off setParent.scrol lTop)'>
    <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>


  • Ivo

    #2
    Re: IE Pixel discrepancy with top / scrollTop

    "Csaba Gabor" <news@CsabaGabo r.com> wrote in message
    news:408e57c2@a ndromeda.datane t.hu...[color=blue]
    > 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:expr ession(this.off setParent.scrol lTop)'>[/color]

    Changing this line to

    <tr style='top:expr ession(this.scr ollTop)'>

    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


    Comment

    Working...