JS dataTables.fixedHeader different width between header and datas

I use the javascript plugin dataTables.fixedHeader and fill the data with ajax. Now I have the problem, that the width of each data-column is dynamically and the header stays on the same static width.

不同的宽度

Code:

HTML:

<table class="table table-striped table-bordered table-hover" id="custTable">
                    <thead>
                        <tr>
                            <th>
                                ......
                            </th>
                            <th>
                                ......
                            </th>
                            <th>
                                ......
                            </th>
......
                        </tr>
                    </thead>
                    <tbody id="dataList"></tbody>
                </table>

JS:

table = $('#custTable').DataTable({
            "dom": "frtiS",
            "deferRender": true,
        });

Fill it:

$('#custTable').dataTable().fnAddData([
               xyz, xyz, xyz, ...
                        ]);

Disable automatic column widths.

JS

table = $('#custTable').DataTable({
            "dom": "frtiS",
            "deferRender": true,
            "autoWidth": false
        });

http://datatables.net/reference/option/autoWidth

链接地址: http://www.djcxy.com/p/27192.html

上一篇: 如何使用Globalize 1.0并获取指定的文化信息

下一篇: JS dataTables.fixedHeader标题和数据之间的不同宽度