I have a requirement to have a scrolling table in both x and y axis.
I achieved this by cloning the existing table header into a new table with jQuery.
I have mocked the issue here:
In IE7 the borders of the cloned thead cells do not align with the parent thbody cells even though the CSS is the same.
Is there a fix for this?
I appreciate that this is not best practice and IE7 is a dying browser but it is a client requirement.
Removing this rule:
made the borders align. But obviously you want to hide the thead on IE7 too, so let’s use an hack!
Then, add this rule:
Working demo
Otherwise, if you want to keep your code “clean”, you can use conditional comments.
Add this code to your head section, after the normal css:
Anyway, you’re using
:first-childand:last-childselectors, but check this compatibility table:last-childwon’t work on IE7 and 8 at allfirst-childworks only on static elements, not on generated contentsTry to use classes instead, if you need full compatibility with IE7+.
There’s also ie9.js which does a great job for CSS3 selectors on older IE versions.
Then you’ve this rule:
are you aware that this rule will overwrite that on the last row?
Maybe you want to use