Basic example
ColVis is a plug-in for DataTables which presents a list of all columns to a user and allows them to select which ones they wish to be visible. Click the "three bars" button to be presented with a list of columns in the table, and click the buttons to show and hide them as you wish. ColVis is added to a DataTable by specifying the C option for dom.
Exclude columns
It can at times be useful to exclude columns from being in the 'show / hide' list (for example if you have hidden information that the end user shouldn't be able to make visible. This can be done by the exclude ColVis configuration parameter when creating the DataTable. This is simply an array of integers, indicating which columns should be excluded. This example shows the first column being excluded.
Button ordering
The list of columns that ColVis displays has two options for the order in which they are displayed. The default mode of operation is to show the buttons in the same order as they appear in the HTML table, but the second mode of operation is to show the buttons in alphabetical order. This is done by specifying the order option, set to alpha. Alphabetical button ordering is shown in this example.
Mouseover activation
The default activation (showing the columns list) for ColVis is for the user to click the button. This can be altered to a mouseover activation by making use of the activate initialisation option and setting it to mouseover. This parameter denotes how the dropdown list of columns can be activated by the end user. Its value should be either mouseover or click.