How do you change the style of cell in a JQuery.DataTable?

后端 未结 5 1330
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-05 02:39

I have a question about setting the style attributes for a data cell in the jQuery.DataTable. I was able to set the width for each column when initializing the

5条回答
  •  -上瘾入骨i
    2021-02-05 03:38

    you can also use something like that to another kind of customizations : inside fnRender you can insert label, span, and set class or style of the element inside this "td"

    "aoColumns": [
                        { "sTitle": "Ativo","sClass": "center","bSearchable": true,
                            "fnRender": function(obj) {
                                var sReturn = obj.aData[ obj.iDataColumn ];
                                return "/"+sReturn.toLowerCase()+"";
                            }                   
                        },
    

提交回复
热议问题