$(document).ready(function() { // initialize datatable $('#dt-basic-upsba').dataTable( { responsive: true, lengthChange: false, dom: /* --- Layout Structure --- Options l - length changing input control f - filtering input t - The table! i - Table information summary p - pagination control r - processing display element B - buttons R - ColReorder S - Select --- Markup < and > - div element <"class" and > - div with a class <"#id" and > - div with an ID <"#id.class" and > - div with an ID and a class --- Further reading https://datatables.net/reference/option/dom -------------------------------------- */ "<'row mb-3'<'col-sm-12 col-md-6 d-flex align-items-center justify-content-start'f>>" + "<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'p>>", buttons: [ { extend: 'colvis', text: 'Column Visibility', titleAttr: 'Col visibility', className: 'btn-outline-default' }, { extend: 'pdfHtml5', text: 'PDF', titleAttr: 'Generate PDF', className: 'btn-outline-default' }, { extend: 'excelHtml5', text: 'Excel', titleAttr: 'Generate Excel', className: 'btn-outline-default' }, { extend: 'csvHtml5', text: 'CSV', titleAttr: 'Generate CSV', className: 'btn-outline-default' }, { extend: 'copyHtml5', text: 'Copy', titleAttr: 'Copy to clipboard', className: 'btn-outline-default' }, { extend: 'print', text: 'Print', titleAttr: 'Print Table', className: 'btn-outline-default' } ], columnDefs: [ { // targets: -1, title: 'Action', orderable: false, render: function(data, type, full, meta) { /* -- ES6 -- convert using https://babeljs.io online transpiler return ` `; ES5 example below: */ return "\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t"; }, }, ] }); });