1
0
mirror of https://github.com/DataTables/DataTables.git synced 2025-02-19 17:54:14 +01:00

Fix: When scrolling is enabled the initial width of the header was being set to 150% which was a bit random and could result in the header flashing its display in the wrong place when loading. The fix is to use 100% unless x-scrolling is being forced, at which point it needs to match the inner table - 8332

This commit is contained in:
Allan Jardine 2012-02-25 07:56:27 +00:00
parent aa0ff53ee5
commit 126a4fe44e
3 changed files with 9 additions and 3 deletions

View File

@ -16,7 +16,11 @@
$('#example').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "../server_side/scripts/server_processing.php"
"sAjaxSource": "../server_side/scripts/server_processing.php",
"sScrollY": "300",
bPaginate: false,
sScrollX: "100%",
sScrollXInner: "120%"
} );
} );
</script>

View File

@ -2954,7 +2954,8 @@
nScrollHead.style.border = "0";
nScrollHead.style.width = "100%";
nScrollFoot.style.border = "0";
nScrollHeadInner.style.width = "150%"; /* will be overwritten */
nScrollHeadInner.style.width = oSettings.oScroll.sXInner !== "" ?
oSettings.oScroll.sXInner : "100%"; /* will be overwritten */
/* Modify attributes to respect the clones */
nScrollHeadTable.removeAttribute('id');

View File

@ -76,7 +76,8 @@ function _fnFeatureHtmlTable ( oSettings )
nScrollHead.style.border = "0";
nScrollHead.style.width = "100%";
nScrollFoot.style.border = "0";
nScrollHeadInner.style.width = "150%"; /* will be overwritten */
nScrollHeadInner.style.width = oSettings.oScroll.sXInner !== "" ?
oSettings.oScroll.sXInner : "100%"; /* will be overwritten */
/* Modify attributes to respect the clones */
nScrollHeadTable.removeAttribute('id');