Column Visibility with Custom Search Fields

后端 未结 1 1277
醉酒成梦
醉酒成梦 2021-01-24 03:30

I am trying to create a datatable with custom search and column visibility.

What I have done is -

HTML

    
1条回答
  •  [愿得一人]
    2021-01-24 03:51

    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.

    0 讨论(0)
提交回复
热议问题