custom styling for columns with ajax populated table?

custom styling for columns with ajax populated table?

coderman1coderman1 Posts: 6Questions: 1Answers: 0
edited January 2014 in DataTables 1.8
I have about 10 different tables on a page that show stock prices. The tables are populated using ajax:

$('#moderateGrid').dataTable(
{ "bServerSide": true,
"bProcessing": true,
"sAjaxSource": "/json_get_stocks/?type=moderate",
"bFilter": false,
"bPaginate": false,
"bSort": false,
"bRetrieve": false,
"bDestroy": true,
"bInfo": false,
"iDisplayLength": 100,
"aaSorting": []
}
);

I used to have this grid populated via html so it was easy to style each cell, but I am a little confused where to add that styling now that its ajax?

Thanks!
Craig

Replies

  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin
    What exactly do you mean by styling for each cell. As in you use some logic to add a class to each individual cell? If so, then fnCreatedCell is what you want here.

    Allan
  • coderman1coderman1 Posts: 6Questions: 1Answers: 0
    Yea i want to be able to change fonts, add images, or class etc
  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin
    Perfect - fnCreatedCell is just the ticket then.

    Allan
This discussion has been closed.