Datatable responsive does not load responsively on first load
Datatable responsive does not load responsively on first load

Datatable responsive does not load responsively on first load but if window resize the responsive api will effect.
What i have done so far:
$('#example').DataTable( {
responsive: {
details: {
display: $.fn.dataTable.Responsive.display.modal( {
header: function ( row ) {
var data = row.data();
return 'Details for '+data[0]+' '+data[1];
}
} ),
renderer: $.fn.dataTable.Responsive.renderer.tableAll( {
tableClass: 'table'
} )
}
}
} );
table:
<table id="example" class="table table-striped table-bordered" style="width: 100%;">
Edited by Kevin: Syntax highlighting. Details on how to highlight code using markdown can be found in this guide
This discussion has been closed.
Answers
Your code works here on first load:
http://live.datatables.net/vucumake/1/edit
Could be your data is not large enough to cause responsive to invoke on first load. Please post a link to your page or a test case replicating the issue so we can take a look. Feel free to update my test case.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin