I\'m using DataTable 1.10.9 (from https://datatables.net). Columns for the datatable are defined at the initialization step in javascript and each column has a unique name, e.g.
below code worked for me
this.api().columns().every(function() {
console.log( this.header().textContent )
})
also you can add a specific html class for only specific column names like having that class
this.api().columns(".myColumnClass").every(function() {
console.log( this.header().textContent )
})