I'm using this code and it is working fine.
But I want to get limited row data and limited words from a row from datatable.
What I'm doing Jquery code:
if( $('.clienttable').length > 0 ) {
$('.clienttable').DataTable( {
pageLength: 10,
responsive: true,
dom: '<"html5buttons"B>lTfgitp',
buttons: [
{
extend: 'copyHtml5',
exportOptions: {
columns: [1, 2, 3,4,5,6]
}
},
{
extend: 'csvHtml5',
exportOptions: {
columns: [1, 2, 3,4,5,6]
}
},
{
extend: 'excelHtml5',
exportOptions: {
columns: [1, 2, 3,4,5,6]
}
},
{
extend: 'pdfHtml5',
exportOptions: {
columns: [1, 2, 3,4,5,6]
},
title: 'List of Clients',
}
],
columnDefs: [
{ targets: [0], orderable: false },
{ targets: [7], orderable: false }
],
"order": [[ 6, "desc" ]]
});
}
Frontend Code:
<table class="table table-striped table-bordered table-hover clienttable" >
</table>
Other Question:
How to remove white spaces text in columns when excel export..? i m getting issues like white spaces in the excel table cell, can this be possible to remove white spaces..?