Friday, May 17, 2024
 Popular · Latest · Hot · Upcoming
155
rated 0 times [  157] [ 2]  / answers: 1 / hits: 18035  / 10 Years ago, fri, november 7, 2014, 12:00:00

I'm using the following code to initialize jQuery DataTables:



var oTable = $('#qpidvulh_to-do_list').dataTable( {
columns: [
{
data: item,
className: editable
}
]
} )


The issue with this code is that it adds the editable class to the th of each column, even though I only want it added to the td of each column.



How can I get the code to only add the editable class to the cells of each column and not their headers?


More From » jquery

 Answers
15

Thanks to mainguy and markpsmith for posting their answers. I'll throw my own solution into the mix, but I'd still like to see what everyone thinks the best performing solution would be:



$('#qpidvulh_to-do_list thead th').removeClass('editable');


[#68867] Thursday, November 6, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
travion

Total Points: 137
Total Questions: 96
Total Answers: 103

Location: India
Member since Wed, Aug 4, 2021
3 Years ago
;