column width set to zero

column width set to zero

floranteflorante Posts: 8Questions: 0Answers: 0
edited August 2010 in General
Hi,

here is my init

[code]
misc_space_type_list_table=$('#misc_space_type_list').dataTable(
{

/* "aoColumns": [
null,
null,
null,
null,
null
],*/
"aoColumnDefs": [
{ "sWidth": "20%", "aTargets": "_all" }
],
"bAutoWidth": false,
"bFilter": false,
"bSort": false,
"sScrollX": "100%",
"sScrollY": 400,
"bProcessing": false,
// "bServerSide": true,
"sAjaxSource": 'get_space_type_list.php?action=0'

}
);
[/code]

I use aoColumnDefs to divide the columns to exactly the same width (5 colums). But the rendered table is far from being 20% of the table width=800px. Firebug shows that each column has a zero width


please see here

http://www.flickr.com/photos/37485943@N05/4861145613/

Im using the latest version

thanks


Florante

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Hi Florante,

    I'm going to guess that you have the table hidden when it is initialised - which is why the widths are all found to be 0. What to do to overcome this is call the fnAdjustColumnSizing API function ( http://datatables.net/api#fnAdjustColumnSizing ) when the table becomes visible.

    Regards,
    Allan
This discussion has been closed.