EDIT PREVIOUS ANSWER
I figured out the best way to use the data APIs:
//You have to pass the datatable object. //in the case of your example you should pass $('#example').dataTable(); var fnGetVisibleColumns = function(oTable) { var counter = 0; aColumns = new Array(); $.each(oTable.fnSettings().aoColumns, function(c){ if(oTable.fnSettings().aoColumns[c].bVisible == true){ aColumns.push(counter) } counter++; }); return aColumns; } //Now you can do var aVisibleColumns = fnfnGetVisibleColumns($('#example').dataTable()); //aVisibleColumns is [1,2] if the user displays only "browser" and "platform" columns
source share