JQuery Datatable Question: Centering column data after data insertion
- by Chris
I have a data table that is initially empty and is populated after a particular Javascript call. After the data is inserted into the table, I'd like to center all of the data in one of the columns. I tried specifying this at the initialization step in this way:
dTable = $('#dt').datatable({ 'aoColumns': [ null, null, { "sClass" : "center" }] });
The data in the third column was not centered after the insertions were complete. I tried modifying aoColumns after the insertions and redrawing the table as well:
dTable.fnSettings().aoColumns[2].sClass = "center";
dTable.fnDraw();
This did not work either. So my question is simply how should I go about telling the data table to center the data in the third column?
Thanks in advance for your suggestions.
Chris