I have added the default Excel button in my datatable.
Here's the script for it :
$('#searchResult').DataTable(
{
"dom": '<"top"lB>rt<"bottom"ip>',
buttons: [
{
extend: 'excel',
exportOptions:
{
columns: ':visible'
}
},
'colvis']
)}
And I've placed the button at the extreme right(top-side) above the data-table through the following css:
.dataTables_wrapper .dt-buttons {
float:right;
}
But I have no idea about how can I replace the Buttons with icons ( to improve the UI) while maintaining the same functionality. And how can I insert the icons at the exact same location as of the buttons??