My table is too large

My table is too large

soiposoipo Posts: 3Questions: 0Answers: 0
edited April 2012 in DataTables 1.9
Hi,
I have just updated to the version 1.9 and I am having the following issue:
My table has 13 rows and I am setting theirs width.
No matter what I do the table has width 2168px, the odd thing is that even if I am trying to resize the table through console, the width won't change.


here my code :

[code]

$('#example').dataTable( {
"bAutoWidth": false,

"aoColumnDefs": [
{ "aTargets":[0],"sWidth": "5%" },
{ "aTargets":[1],"sWidth": "5%" },
{ "aTargets":[2],"sWidth": "10%" },
{ "aTargets":[3],"sWidth": "15%" },
{ "aTargets":[4],"sWidth": "5%" },
{ "aTargets":[5],"sWidth": "10%"},
{ "aTargets":[6],"sWidth": "5%" },
{ "aTargets":[7],"sWidth": "5%" },
{ "aTargets":[8],"sWidth": "5%" },
{ "aTargets":[9],"sWidth": "5%" },
{ "aTargets":[10],"sWidth": "5%" },
{"aTargets": [11], "sWidth": "10%" },
{ "aTargets":[12],"sWidth": "15%" ,"bSortable": false }
],
"iDisplayLength": 25,
"sPaginationType": "full_numbers",
"bProcessing": true,
"bServerSide": true,
"bPaginate": true,
"bJQueryUI": false,

"aaSorting": [[0,'desc']],

"sAjaxSource": "<?=site_url("/tables/tablecreator");?>",
"bJQueryUI": true,
"oLanguage": {
"sSearch": "Search all columns:"
},
"fnServerData": function ( sSource, aoData, fnCallback ) {
$.ajax( {
"dataType": 'json',
"type": "POST",
"url": sSource,
"data": aoData,
"success": fnCallback
} );
}
} );

[/code]

Thanks for the help.

Replies

  • allanallan Posts: 61,635Questions: 1Answers: 10,092 Site admin
    Can you link to your example for me please, so I can see it in action? At the moment I can only assume that the content in the table is forcing the width?

    Allan
  • soiposoipo Posts: 3Questions: 0Answers: 0
    Allan, can I send you a private email ? It is an internal application, so I would like to avoid to post a link on the forum.
  • allanallan Posts: 61,635Questions: 1Answers: 10,092 Site admin
    Thanks for the mail :-). It looks to me that the width is being forced by the input boxes in the footer. If you remove then, does it work as expected? It might be that if you want the input boxes to remain at that size then you could enable sScrollX as an option.

    Allan
  • soiposoipo Posts: 3Questions: 0Answers: 0
    Hi Allan,
    you are a star, thank you so much !
    I have just give 100% width to the input and and all went smooth !
This discussion has been closed.