Specify visible columns
You can set the visibility with the parameters or to specific columns along with the parameter to set the visibility of the columns. columnDefs columnDefs columns columnDefs columns.visible
For example, to initially hide the second column, use the following options:
var table = $('#example').DataTable({
'columnDefs': [
{ targets: 1, visible: false }
]
});
See this jsFiddle for a demo.
Get a list of visible columns
, columns().visible().
var colVisible = table.columns().visible();
jsFiddle .