我已经在数据表中创建了导出选项,我希望它现在显示在表下方。谈论要在分页旁边的表格末尾显示的下载按钮。
$(document).ready(function (){
var table = $('#example').DataTable({
'responsive': true,
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
// Handle click on "Expand All" button
$('#btn-show-all-children').on('click', function(){
// Expand row details
console.log('Inside click');
table.rows(':not(.parent)').nodes().to$().find('td:first-child').trigger('click');
});
// Handle click on "Collapse All" button
$('#btn-hide-all-children').on('click', function(){
// Collapse row details
table.rows('.parent').nodes().to$().find('td:first-child').trigger('click');
});
$('#btn-show-all-children').trigger('click');
});
Run Code Online (Sandbox Code Playgroud)