Head/Body misalignment when both horizontal/vertical scrolling is enabled
Head/Body misalignment when both horizontal/vertical scrolling is enabled
mmarchetta
Posts: 1Questions: 0Answers: 0
Hi guys,
When both sScrollY and sScrollX are used, if you scroll horizontally up to the limit then the head and the body of the table get misaligned because when the vertical scrollbar appears next to the body it's included in the body's width.
You can see this in the example in the site:
http://datatables.net/release-datatables/examples/basic_init/scroll_xy.html
When you scroll up to the limit at the right you'll see that at some point the header stays fixed and the body keeps scrolling.
The problem is that if you CSS the table and user lines for separating columns this is too visible.
I think that 2 potential solutions would be either (a) make the viewport of the body wider so the scrollbar is out of it; or (b) make the header wider so the header's width = body's width + scrollbar's width. But not sure (didn't look into the code).
Thanks!
Martin
When both sScrollY and sScrollX are used, if you scroll horizontally up to the limit then the head and the body of the table get misaligned because when the vertical scrollbar appears next to the body it's included in the body's width.
You can see this in the example in the site:
http://datatables.net/release-datatables/examples/basic_init/scroll_xy.html
When you scroll up to the limit at the right you'll see that at some point the header stays fixed and the body keeps scrolling.
The problem is that if you CSS the table and user lines for separating columns this is too visible.
I think that 2 potential solutions would be either (a) make the viewport of the body wider so the scrollbar is out of it; or (b) make the header wider so the header's width = body's width + scrollbar's width. But not sure (didn't look into the code).
Thanks!
Martin
This discussion has been closed.
Replies
Thanks,
Allan
It does it on your own example. I don't think there's anything you can do about it. It doesn't appear as bad on your example because you don't have separators on your column headers but it does it just as much as ours does.
As soon as you scroll back the distance of the skew, it repairs itself.
Allan
What could be wrong ?
Thanks in advance !
[code]
DataTables live example
@import "http://live.datatables.net/media/css/demo_table.css";
window.onload = (function() {
$('#example').dataTable( {
"sScrollY": 200
} );
} );
Live example
Rendering engine123
Browser
Platform(s)
Engine version
CSS grade
Trident
Internet Explorer 4.0
Win 95+
4
X
Trident
Internet Explorer 5.0
Win 95+
5
C
Trident
Internet Explorer 5.5
Win 95+
5.5
A
Trident
Internet Explorer 6
Win 98+
6
A
Trident
Internet Explorer 7
Win XP SP2+
7
A
Trident
AOL browser (AOL desktop)
Win XP
6
A
Gecko
Firefox 1.0
Win 98+ / OSX.2+
1.7
A
Gecko
Firefox 1.5
Win 98+ / OSX.2+
1.8
A
Gecko
Firefox 2.0
Win 98+ / OSX.2+
1.8
A
Gecko
Firefox 3.0
Win 2k+ / OSX.3+
1.9
A
Gecko
Camino 1.0
OSX.2+
1.8
A
Gecko
Camino 1.5
OSX.3+
1.8
A
Gecko
Netscape 7.2
Win 95+ / Mac OS 8.6-9.2
1.7
A
Gecko
Netscape Browser 8
Win 98SE+
1.7
A
Gecko
Netscape Navigator 9
Win 98+ / OSX.2+
1.8
A
Gecko
Mozilla 1.0
Win 95+ / OSX.1+
1
A
Gecko
Mozilla 1.1
Win 95+ / OSX.1+
1.1
A
Gecko
Mozilla 1.2
Win 95+ / OSX.1+
1.2
A
Gecko
Mozilla 1.3
Win 95+ / OSX.1+
1.3
A
Gecko
Mozilla 1.4
Win 95+ / OSX.1+
1.4
A
Gecko
Mozilla 1.5
Win 95+ / OSX.1+
1.5
A
Gecko
Mozilla 1.6
Win 95+ / OSX.1+
1.6
A
Gecko
Mozilla 1.7
Win 98+ / OSX.1+
1.7
A
Gecko
Mozilla 1.8
Win 98+ / OSX.1+
1.8
A
[/code]
Well that's true. After struggling a long period, I decided use an old lame hack.
[code]setTimeout(function () {oTable.fnAdjustColumnSizing();}, 50)[/code]