将数据表导出按钮移到表底部

Aru*_*air 0 datatable jquery angularjs

我已经在数据表中创建了导出选项,我希望它现在显示在表下方。谈论要在分页旁边的表格末尾显示的下载按钮。

$(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)

这是小提琴https://jsfiddle.net/x5q3anys/

Bil*_*l P 5

domsettings string处,将其放在字符串B末尾,如下所示:

dom: 'frtipB'
Run Code Online (Sandbox Code Playgroud)

从文档中:

DataTables中的每个表控件元素都有一个与之关联的字母,该字母在此dom配置选项中用于指示该元素将在文档顺序中出现的位置。

阅读更多:文档