Prevent column stretching
Prevent column stretching
I have a table in which the number of columns is dynamic; it could be 2 columns or 100 columns. Is there any way to prevent the column widths from stretching? I hope to avoid having to declare a fixed px width for each column. Also, horizontal scrolling needs to also work. I hate when I have only a 2 column table and the columns stretch out to fill the browser width.
Here is my code:
var oTable = $('#slot').dataTable( {
"bAutoWidth" : false,
"sScrollY": 500,
"bScrollCollapse": true,
"bFilter": false,
"bPaginate": false,
"bSort": false,
"asStripeClasses": [ ],
"sDom": 'C<"clear">lfrtip',
"oColVis": {
"fnLabel": function ( index, title, th ) {
return ''+ th.getAttribute('title') + '';
},
"buttonText": "Adjust Drives",
"aiExclude": [ 0 ],
"bRestore": true,
"sAlign": "left"
},
});
Thanks for any help.
Here is my code:
var oTable = $('#slot').dataTable( {
"bAutoWidth" : false,
"sScrollY": 500,
"bScrollCollapse": true,
"bFilter": false,
"bPaginate": false,
"bSort": false,
"asStripeClasses": [ ],
"sDom": 'C<"clear">lfrtip',
"oColVis": {
"fnLabel": function ( index, title, th ) {
return ''+ th.getAttribute('title') + '';
},
"buttonText": "Adjust Drives",
"aiExclude": [ 0 ],
"bRestore": true,
"sAlign": "left"
},
});
Thanks for any help.
This discussion has been closed.