1$('#example').dataTable( {
2 "autoWidth": false, // might need this
3 "columns": [
4 { "width": "20%" },
5 null, // automatically calculates
6 null // remaining width
7 ]
8} );
1table.display {
2 margin: 0 auto;
3 width: 100%;
4 clear: both;
5 border-collapse: collapse;
6 table-layout: fixed; // add this
7 word-wrap:break-word; // add this
8}
9
1$('#example').dataTable({
2 "columnDefs": [
3 { "width": "20%", "targets": 0 }
4 ]}
5);
1$('#table_selector').dataTable( {
2 "autoWidth": false, //<-------- add this
3 //give custom width
4 "columns": [
5 { "width": "10%" },
6} );