Unable to set width of column? The width size is huge.
Unable to set width of column? The width size is huge.
sahu_golu
Posts: 3Questions: 2Answers: 0
$(document).ready(function() {
$("#dataTables-example';echo $j; echo'").DataTable( {
initComplete: function () {
this.api().columns().every( function () {
var column = this;
var select = $("<select><option value=\"\"></option></select>")
.appendTo( $(column.footer()).empty() )
.on( "change", function () {
var val = $.fn.dataTable.util.escapeRegex(
$(this).val()
);
column
.search( val ? "^"+val+"$" : "", true, false )
.draw();
} );
column.data().unique().sort().each( function ( d, j ) {
select.append( "<option value=\""+d+"\">"+d+"</option>" )
} );
} );
},
"autoWidth": false,
"columnDefs": [
{ "width": "300px", "targets": 0 }]
} );
} );
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I'd suggest removing that to start with.
If it still doesn't work, please link to a test case showing the issue.
Allan