如何在jquery数据表中对齐td值

时间:2018-03-01 11:46:02

标签: jquery datatables



$("#demo").dataTable({

  "data": Data,
  // "sDom": '<lr>t<"F"ip>',
  "sDom": 'Brtip',
  "bInfo": false,
  "bLengthChange": false,
  "bPaginate": false,
  "destroy": true,
  "iDisplayLength": 9,
  "autoWidth": false,
  "responsive": true,
  "columnDefs": [{
    "targets": [0],
    "sTitle": ColumnArray[0],
    "sortable": true,
    "searchable": false, //Scheme Name



    "createdCell": function(th, td, cellData, rowData, row, col) {

      var value = jQuery.isNumeric(cellData);



      if (value === true) {
        $(td).addClass(text_right);
        $(th).addClass(text_right);

      } else {
        $(td).addClass(text_left);
        $(th).addClass(text_right);

      }

    },
    "render": function(data, type, row, meta) {

      var SchemeColHTML = CreateDataHTMLSec(data, type, row, meta);
      return SchemeColHTML;
    }

  }];
});
&#13;
&#13;
&#13;

我想将td文本与数值对齐我能够对齐td但是如何对齐相应的我使用jquery数据表如果数字对齐th或者左对齐

0 个答案:

没有答案