Quantcast
Viewing all articles
Browse latest Browse all 82161

Buttons export and appendTo many datatables

I have 12 datatables:

    <table id = "TABLE_1" class = "table table-striped"> 
    <table id = "TABLE_2" class = "table table-striped">

I need to display datatables with export and visibility buttons.
This is the datatables-init.js file

    $(document).ready(function() {
        var table = $("table[id^='TABLE']").DataTable( {
    
            buttons: ['copy', 'excel', 'pdf', 'colvis']
        });
        table.buttons().container()
            .appendTo(table.DataTable()('.col-md-6:eq(0)'));
    } );

The buttons do not display, I know that this is a problem with the place where they are displayed. Can anyone help ?


Viewing all articles
Browse latest Browse all 82161

Trending Articles