javascript - JQuery Datatable Question: Centering column data after data insertion -


I have a data table that is initially empty and has a population after a particular JavaScript call. After the data is entered in the table, I want to focus all the data in one of the columns. I tried to specify it in the initial step like this:

  dTable = $ ('# dt'). Dataset ({'aoColumns': [null, null, {"sClass": "center"}]});  

After the completion of the merger the data was not centered in the third column. After the insertion and underlining the table, I tried to modify the AO column:

  dTable.fnSettings (). AoColumns [2] .sclass = "center"; DTable.fnDraw ();  

This does not work either. So my question is, where should I go to the data table to focus on data in the third column?

Thank you in advance for your suggestions.

Chris

If I understand you correctly, then your table Multiple columns found with ajax data with multiple rows. The third column should be centered. Try it out:

  $ Ajax ({url: 'ajax / test.html', success: function (data) {// fill out the // table after AJAX is completed. $ ('(' TR '; // center third column.});} });  

Alternatively, if you do not like to use attributes, you can use or use style attributes, or you can add a class with it.


Comments