I have the following JS
$(document).ready(function() { var table = $('#example').DataTable( { "scrollY": "200px", "paging": false } ); $('a.toggle-vis').on( 'click', function (e) { e.preventDefault(); // Get the column API object var column = table.column( $(this).attr('data-column') ); // Toggle the visibility column.visible( ! column.visible() ); } ); } ); Which produce the following table that allows user to toggle the six columns by clicking on the link next to Toggle column.

What I want to do then is to make the table to show only Name and Position column as default and hide the rest of columns. Only when the user toggle their preferred other columns then they will appear. How can this be achieved?
In reality I have ~50 columns to show. Currently it overflow the page. Not sure what's the best way to display such case.
