DataTables - Not working when added colspan for the last column

后端 未结 4 507
不知归路
不知归路 2020-11-30 08:52

I\'ve a problem using DataTables. When i add colspan for the last column, the datatable plugin wont get applied to the table. If i remove the colspan for the last one and pu

4条回答
  •  感动是毒
    2020-11-30 09:38

    DataTables doesn't support colspans like you're using them. Follow their complex header example instead.

    When using tables to display data, you will often wish to display column information in groups. DataTables fully supports colspan and rowspans in the header, assigning the required sorting listeners to the TH element suitable for that column. Each column must have one TH cell (and only one) which is unique to it for the listeners to be added. The example shown below has the core browser information grouped together.

    
        
            Rendering engine
            Browser
            Details
        
        
            Platform(s)
            Engine version
            CSS grade
        
    
    

    Your equivalent would look something like this:

    
          
          
    
          
          
      
     
          
          
    
          
          
     
    
    

提交回复
热议问题