2

请参阅此页面: http: //live.datatables.net/fadoteba/1/

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

<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>

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

4

2 回答 2

1

你的问题是桌子的风格。它会自动在您的桌子上设置表格布局属性。我将以下行添加到 css 以解决问题:

table {
   table-layout: auto !important;
}

数据表链接

于 2016-04-14T08:22:40.910 回答
1

有点晚了,但我在这个问题上花了 6 个小时,直到我偶然发现了从 CSS 中删除表格布局的解决方案,然后我在这里找到了这个解决方案!

.dataTable.fixedHeader-floating {
    table-layout: auto !important;
}
于 2017-07-12T13:43:56.330 回答