IE8 fixed table header

Soldato
Joined
18 Oct 2002
Posts
4,925
Location
Yorkshire
Throwing this question out there as it seems to have got me stuck for now.

I'm running IE8 in Compatibility Mode.
I've got a table with a fixed header on scrolling which is working fine. However if you include say a button in a table cell which has a css hover effect i.e. to shift the background image on the button, its causing the fixed header to shift.

Anyone know a decent fix for this besides javascript/jquery ?
 
Hmm it doesn't seem to do it for me (it did once I think, but I wasn't really looking :o).

In Firefox the table headers are clipping the scroll bar, and there seems to be a lots of HTML errors- most of them look simple to fix, i.e. missing quotes: <th scope=col> should be <th scope="col"> or not closing img tags with /> (XHTML syntax). Maybe fixing these will clear up the other errors, it usually does.
 
Hmm it doesn't seem to do it for me (it did once I think, but I wasn't really looking :o).

In Firefox the table headers are clipping the scroll bar, and there seems to be a lots of HTML errors- most of them look simple to fix, i.e. missing quotes: <th scope=col> should be <th scope="col"> or not closing img tags with /> (XHTML syntax). Maybe fixing these will clear up the other errors, it usually does.

Yep ignore all the other browsers were only supporting IE8 in IE7 compatibility mode. Were in a controlled environment and the bit that needs this fixed table header is legacy code.

i've fixed the code for you but it still has the same problem in IE8 with Compatibility Come enabled.
 
Ah, finally got it to 'work' (break). If I shrink my browser window it does it, if it leave it full-screen it doesn't.

Solution: remove background-position from:

Code:
.TestingButtonVersion1:hover
{
	background-position: 0 -25px; 
}

If you scroll down ever so slightly from the top of the page (move the bar literally a millimetre) you can see that as you hover over the button the header moves up slightly. If you refresh the page and scroll down further it gets moved up even more (out of sight infact) which is why it disappears.
 
lol if you read the 1st post I that this bit of css was the problem :) i'm trying to find a work around as I need to hover effect.
 
managed to sort it.

just needed
top: 0px;
left: 1px;

adding to the "thead tr" style

dam you microsoft
 
Back
Top Bottom