How to use rowspan and colspan in tbody using datatable.js?

前端 未结 7 1544
既然无缘
既然无缘 2020-11-29 06:36

Whenever I use , I get the following error:

Uncaught TypeError: Cannot set property \'_DT_CellIndex\'

7条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-29 07:06

    You can hack around the lack of colspan support by adding an "invisible" cell for every cell that's eliminated:

    
     Wide column
     
     
    
    
     Normal column
     Normal column
     Normal column
    
    

    DataTables doesn't complain, the table renders normally and sorting works (invisible columns sort as the empty string).

    I haven't tried this with rowspan.

提交回复
热议问题