Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

datatables dynamically hide columns

const table = $('#example').DataTable();

// Get the column API object
const column = table.column( 2 ); // gets 2nd column (0-indexed)
 
// Toggle the visibility
column.visible( ! column.visible() ); // true or false
Source by datatables.net #
 
PREVIOUS NEXT
Tagged: #datatables #dynamically #hide #columns
ADD COMMENT
Topic
Name
1+7 =