简体   繁体   中英

freeze table header using datatables plugin

I am using datatables plugin and trying to freeze my table header, and the table is created using displaytag. My issue is that there is some problem with the column width in the header. It is not same as the column width of the body. How to make the header width same as body width?

My code:

$("#rates").dataTable({
     "bPaginate": false,
     "sScrollY":  "200px",
     "sScrollX": "100%",
});

Remove the last comma after sScrollX 100% and see.

$("#rates").dataTable(
    { 
        "bPaginate": false, 
        "sScrollY": "200px", 
        "sScrollX": "100%"
    }
);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM