jQuery Datatables align center 1 column

前端 未结 4 1384
太阳男子
太阳男子 2021-02-05 02:51

Want to align center just the first column called \"Status\":

        $(\"#TransactionTable\").DataTable({
            ajax: {
                url: \'/Transactio         


        
4条回答
  •  滥情空心
    2021-02-05 03:40

    You can also specify a single css class name inside each column object.

    In your case:

    {
        data: 'Status', 
        render: function (data, type, row) {
            switch (data) {
                case 1:
                     return '
    '; case 2: return '
    '; case 3: return '
    '; } }, className: "text-center" }

提交回复
热议问题