DataTables Width Problem!!!

DataTables Width Problem!!!

skrchskrch Posts: 3Questions: 0Answers: 0
edited May 2012 in DataTables 1.9
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]

Replies

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    > { "sWidth": "88px", "aTargets": [ "_all" ] }

    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
  • skrchskrch Posts: 3Questions: 0Answers: 0
    edited May 2012
    Hi, 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
  • skrchskrch Posts: 3Questions: 0Answers: 0
    edited May 2012
    allan, I forgot to tell you that I generate the table dynamically with C# and I have style attribute with width="100%" on whole table. Part of the whole table is fixed, the first 6 columns, and the other column, which number of columns is different every time, is scrollable by "X".
This discussion has been closed.