DataTables - FixedHeader - thead 对齐问题中的多个 tr

DataTables - FixedHeader - multiple tr in thead alignment issue

请查看此页面:http://live.datatables.net/fadoteba/1/

我遇到的问题是,当我有这样的 thead 时:

<thead>
    <tr style="background-color: #99b3ff">
        <th align="left" colspan="13">
            somelongnamehere-dsadsadsadsadsadsa<br />
            Total LPARs: 9<br />
            Planned LPARs: 0<br>
            <br>
            Free memory: 286 GB (excl planned lpars)<br />
            Total vCPU (incl planned): 21
        </th>
    </tr>
    <tr>
        <th width="100">Customer</th>
        <th>Frame</th>
        <th>LPAR</th>
        <th>CPU<br>Virtual</th>
        <th>Cluster</th>
        <th>Bubble</th>
        <th>ProcPool</th>
        <th>Mem (GB)</th>
        <th>Add<br>Mem (GB)</th>
        <th>Total<br>Mem (GB)</th>
        <th>Mem<br>overhead (GB)</th>
        <th>AME</th>
        <th>ReqID</th>
    </tr>
</thead>

它搞砸了 fixedheader 的对齐方式,当我用 th 和 colspan 删除第一个 <tr> 时,它会像它应该的那样工作(也可以在示例中向下滚动以查看它)。我该怎么做才能解决这个问题,或者我做错了什么?

你的问题是 table 的风格。它会自动在您的 table 上设置 table-layout 属性。 我将以下行添加到 css 以解决问题:

table {
   table-layout: auto !important;
}

Datatable Link

有点晚了,但我在这个问题上花了 6 个小时,直到我无意中发现了从 CSS 中删除 table-layout 的解决方案,然后我在这里找到了这个解决方案!

.dataTable.fixedHeader-floating {
    table-layout: auto !important;
}