How to center align datatables header

前端 未结 4 1906
渐次进展
渐次进展 2021-02-19 23:32

I\'m new to datatables. When I make table header, it\'s always left align. How can I set the header to center align? I\'ve read datatables.net/manual/styling/classes and datatab

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-20 00:12

    by using this style :

    table.center-all td,th{
        text-align :center;
    }
    

    I can add the center-all class to my table and everything will be aligned to center. like this :

    
        ....
    

    In this way I have the option to center the content of some tables without need to apply it to the whole page/site

提交回复
热议问题