Row and Header(Footer) widths do not match in IE
Row and Header(Footer) widths do not match in IE
TheDenominater
Posts: 6Questions: 0Answers: 0
Hi,
I'm having trouble implementing horizontal scrolling on my table in IE 7 and 8 (don't need 6). When I enable scrolling there is a problem in IE about the widths of the rows and the header/footers. For some reason the rows widths do not align with the header widths. Typically the rows have wider columns than the headers. I also see a sliver of a duplicate header below the "true" header. Hopefully this shot makes things clearer.
http://imgur.com/fGYhr.png
My table initialisation is as follows:
[code]
hmis_query_server_temp: function(query_name, target, parameters){
$.uiLock();
$.ajax({
url: '/php_scripts/queries/query_temp_server.php',
data: {query_name: query_name , parameters: parameters},
success: function(data) {
$(target).html(data);
var oTable = $("#dataSet").dataTable({
"oLanguage": {
"sSearch": "Search all columns:"
},
"sScrollX": "100%",
"sDom": '<"top"<"button_holder">fl>rt<"bottom"ip>',
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "/php_scripts/server_processing/temp_server_processing.php",
"fnServerData": function ( sSource, aoData, fnCallback ) {
aoData.push( { "name": "query_name" , "value": query_name} );
$.getJSON( sSource, aoData, function (json) {
fnCallback(json);
$.uiUnlock();
} );
}
});
});
}
[/code]
My css :
http://pastebin.com/JL8Gpjs7
This only happens in IE and only when scroll is enabled. Any ideas why? My css is just a slight modification of the demo file provided with the plugin. I've verified my JSON output with JSLint and it is valid.
And on a side note, I'm just wondering how the bAutoWidth works, is it supposed to make every column the same width? It seems to do that to me.
Thanks for the help.
I'm having trouble implementing horizontal scrolling on my table in IE 7 and 8 (don't need 6). When I enable scrolling there is a problem in IE about the widths of the rows and the header/footers. For some reason the rows widths do not align with the header widths. Typically the rows have wider columns than the headers. I also see a sliver of a duplicate header below the "true" header. Hopefully this shot makes things clearer.
http://imgur.com/fGYhr.png
My table initialisation is as follows:
[code]
hmis_query_server_temp: function(query_name, target, parameters){
$.uiLock();
$.ajax({
url: '/php_scripts/queries/query_temp_server.php',
data: {query_name: query_name , parameters: parameters},
success: function(data) {
$(target).html(data);
var oTable = $("#dataSet").dataTable({
"oLanguage": {
"sSearch": "Search all columns:"
},
"sScrollX": "100%",
"sDom": '<"top"<"button_holder">fl>rt<"bottom"ip>',
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "/php_scripts/server_processing/temp_server_processing.php",
"fnServerData": function ( sSource, aoData, fnCallback ) {
aoData.push( { "name": "query_name" , "value": query_name} );
$.getJSON( sSource, aoData, function (json) {
fnCallback(json);
$.uiUnlock();
} );
}
});
});
}
[/code]
My css :
http://pastebin.com/JL8Gpjs7
This only happens in IE and only when scroll is enabled. Any ideas why? My css is just a slight modification of the demo file provided with the plugin. I've verified my JSON output with JSLint and it is valid.
And on a side note, I'm just wondering how the bAutoWidth works, is it supposed to make every column the same width? It seems to do that to me.
Thanks for the help.
This discussion has been closed.
Replies
As for auto width - yes it does a lot more. It will try to calculate the column widths to be used (based on the table flow) and then use those widths.
Allan
http://imgur.com/qaRA4.png
There are no console messages in firebug, I'm not sure what you mean by changing the console.log() call to alert though, doesn't _fnLog already do that for me? Sorry if I misunderstood.
Thank you so much for all your help.
However - I'm not sure that is going to help. I believe that there is a bug with measuring widths of an input box in a table footer in IE7 (including IE8 compatibility - since that is basically IE7). Have a look at this conversation between iuliandum and myself: http://datatables.net/forums/comments.php?DiscussionID=2293#Item_35 . I'm not sure how much I can do to fix this issue I'm afraid :-(
Allan
The problem does go away when I remove the input elements in the footer, I'll probably just do that for IE 7.
Any ideas about the issue in Firefox? I've tried adding a rule to hide that extra header row, but it does more harm then good.
Allan
http://imgur.com/k4RjL.png
Thanks again so much for your help.
Failing that, you could use Conditional-CSS: http://conditional-css.com/ :-)
Allan
[code]
$(document).ready(function () {
$('#example').dataTable({ "bJQueryUI": true,
"bSort" : true,
"bFilter" : false,
"bLengthChange": false,
"bInfo": true,
"bPaginate": false,
"aoColumns": [{ "bSortable": false }, null, null, null, null, null, null, null, null, { "bSortable": false}],
"sDom": 't<"fg-toolbar ui-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix"ip>',
"sScrollY": "250px"
});
});
[/code]
css files from examples for jquery ui. Headers widths don't match columns widths. I found that when I remove border-collapse: collapse; from table.display style
[code]
table.display {
margin: 0 auto;
width: 100%;
clear: both;
padding: 0;
margin: 0;
border-collapse: collapse; /* remove this line */
}
[/code]
headers and columns are aligned correctly, but of course borders are doubled. Any advice or hint?