I am trying to create a datatable with custom search and column visibility.
What I have done is -
HTML
SOLUTION
You're using two thead
elements, make it one with two rows instead as shown below.
Employee name
Salary
Position
City
Extension
Joining date
Age
Also in this case you need to use orderCellsTop: true option to tell DataTables to use top row for sorting.
DEMO
See this jsFiddle for code and demonstration.