You can use this plugin.
$.fn.dataTable.Api.register( 'column().title()', function () { var colheader = this.header(); return $(colheader).text().trim(); } );
OR
use cdn
//cdn.datatables.net/plug-ins/1.10.16/api/column().title().js
Now use this code to get table header.
var table = $('#example').DataTable(); table.column( 0 ).title();
Question and answer is powered by AnsPress.io