/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Fixed table header using expression() causes 1px shift

I am using the technique described here:

[url]http://rcswebsolutions.wordpress.com/2007/01/02/scrolling-html-table-with-fixed-header/[/url]

to cause a scrolling table’s header cells to stay “fixed” (like
freezing cells in Excel).

The technique works pretty well, except that the whole header row
seems to snap 1px right when scrolling down. I came up with a work-
around that almost completely works:

[CODE]div.scrollTableContainer thead tr {
position:relative;
top: expression(offsetParent.scrollTop+”px”);
left: expression(offsetParent.scrollTop == 0 ? 0+”px” : -1+”px”);
}[/CODE]

This workaround keeps the header in place on page load and also when
scrolling. However, if you scroll all the way back up, the header
snaps to the right again. Scroll back down and it goes back into
place.

Help will be very much appreciated!

to post a comment
CSS

1 Comments(s)

×

Success!

Help @mrtwice99 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...