RogerRoger
RogerRoger

Reputation: 105

How to add a class to a fixedcolumn

I am using the Datatables jquery plugin and have a table with a fixed column:

 new $.fn.dataTable.FixedColumns(oTable);

Now the fixed column appears to be a clone of the real column and the clone is displayed over the table making it look fixed.

For this cloned column how can I have a specific class added to each of the rows?

This table is paginated and used server side data for each page.

Upvotes: 2

Views: 222

Answers (2)

RogerRoger
RogerRoger

Reputation: 105

Following nikhil's suggestion with "sClass" and the Datatables documentation of "aoColumns".

 oTable = $('#the-table').dataTable({
     ' aoColumns' : [
           {'sClass' : 'clickable'} // adds css class "clickable" to the first column
       ]
 });

Upvotes: 1

nikhil
nikhil

Reputation: 201

using sclass attribute like:

 { "mData": "Bound","sClass"="yourClassName" "sTitle": "Bound" }

this will add the class attribute to the html code generated by datatable plugin

hope this helps

Upvotes: 0

Related Questions