DataTables Width Problem!!!
DataTables Width Problem!!!
skrch
Posts: 3Questions: 0Answers: 0
I have dynamically created table that have 6 fixed columns on the left side and dynamically generated columns, every time different amount of columns, on the right side with slider by "X" and "Y". The problem is that the fixed headers cells in the header ("th - elements") are not having the same width with the fixed body cells in the body ("td - elements"). I used this "{ "sWidth": "100px", "aTargets": [ "_all" ] }" but does not work and other examples I found but without good results.
HOW CAN I SET WIDTH ON THE CELLS?
This is sample of my properties code:
[code]
Properties = {
"sScrollX": "100%",
"sScrollY": "300px",
"bPaginate": false,
"bScrollCollapse": true,
"bAutoWidth": false,
"bLengthChange": false,
"bFilter": false,
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"iDisplayLength": 10,
"bDestroy": true,
"aoColumnDefs": [
{
"sSortDataType": "dom-text",
"sType": 'string',
"aTargets": ['_all']
},
{ "sWidth": "88px", "aTargets": [ "_all" ] }
],
"sDom": '<"fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix toolbar"<"clear">>rt<"fg-toolbar ui-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix"pfil<"clear">>',
"fnInitComplete": function (oSettings) { },
}
[/code]
HOW CAN I SET WIDTH ON THE CELLS?
This is sample of my properties code:
[code]
Properties = {
"sScrollX": "100%",
"sScrollY": "300px",
"bPaginate": false,
"bScrollCollapse": true,
"bAutoWidth": false,
"bLengthChange": false,
"bFilter": false,
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"iDisplayLength": 10,
"bDestroy": true,
"aoColumnDefs": [
{
"sSortDataType": "dom-text",
"sType": 'string',
"aTargets": ['_all']
},
{ "sWidth": "88px", "aTargets": [ "_all" ] }
],
"sDom": '<"fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix toolbar"<"clear">>rt<"fg-toolbar ui-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix"pfil<"clear">>',
"fnInitComplete": function (oSettings) { },
}
[/code]
This discussion has been closed.
Replies
Does your table width (i.e. the 100%) === 88 * columns? There are a lot of things that can cause this - can you:
1. Make sure you are using the very latest versions of the software (including the nighties)
2. Give me a link to your table.
Allan
Thank you for your response.
1. I am using version 1.9.1
My fixed number of columns is 6. I am using extension for Datatables for Fixed Columns version 2.0.2. The fixed width in that section is 540px and that is correct except the width of the columns. The "88px" is (6 columns * 88 = 526) + (1px for border = 12 ) = 540px complete width.
Sample code for fixedcolums part:
[code]
new FixedColumns(table, {
"iLeftColumns": 6,
"iLeftWidth": 540
});
[/code]
2. My app is not public so I can not give you a link, sorry :(
Link of sample image:
http://img708.imageshack.us/img708/715/dtsample.png