AutoWidth doesn't work?
AutoWidth doesn't work?
NickOver
Posts: 4Questions: 2Answers: 0
Hi!
I use dataTables 1.10.12 so, i shoud have autoWidth options. Unfortunately with that option datatables still know better table width (omitting width from html tr elements, container width). I'm guessing it's because page container has big margin. Here is html:
<div style="width: 100%;">
<table class="table" id="list" width="100%">
<thead>
<tr class="success" style="max-width: 100%;">
<th width="6%"><b></b></th>
<th width="10%"><b></b></th>
<th width="10%"><b></b></th>
<th width="10%"><b></b></th>
<th width="10%"><b></b></th>
<th width="10%"><b></b></th>
<th width="10%"><b></b></th>
<th width="10%"><b></b></th>
<th width="10%"><b></b></th>
<th width="7%"><b></b></th>
<th width="7%"><b></b></th>
</tr>
...
And js:
"initComplete" : function() {
$('#filing-date').keyup(function(){
table.column('1').search(this.value).draw();
});
$('#declarant').keyup(function(){
table.column('3').search(this.value).draw();
});
$('#customer').keyup(function(){
table.column('4').search(this.value).draw();
});
$('#shop-addres').keyup(function(){
table.column('5').search(this.value).draw();
});
$('#enter-date').keyup(function(){
table.column('6').search(this.value).draw();
});
$('#contact').keyup(function(){
table.column('7').search(this.value).draw();
});
$('#status').change(function() {
table.column('2').search(this.value).draw();
});
$('#painting').change(function() {
table.column('8').search(this.value).draw();
})
},
"bSortCellsTop": true,
"pageLength": 100,
sDom: '<"H"pr>t<"F"ip>',
"autoWidth": false,
"language": {
"url": "//cdn.datatables.net/plug-ins/1.10.13/i18n/Polish.json"
},
"columnDefs": [{
"targets": [8, 9],
"orderable": false
}],
"order": [[ 0, "asc" ]]
How can i preach width?
Thanks for any help.
This discussion has been closed.