添加许多列后,数据表无响应

时间:2019-01-29 02:35:55

标签: javascript html

指定所有要显示的列后,我的数据表没有响应。假设今天我输入了以下代码:

<table id="tableWithdrawalList" class="display responsive nowrap  table table-striped table-lightfont" style="width:100%; border-top:1px solid grey;">
    <thead>
        <tr>
            <th class="text-left"><input type="checkbox" title="Select all" id="selectedAllRadio" onclick="checkUnCheckAll()" /></th>
            <th class="text-left">Request Receipt</th>
            <th class="text-left">Created Date</th>
            <th class="text-left">Serial Number</th>
            <th class="text-left">Full Name</th>
            <th class="text-left">Email</th>
            <th class="text-left">Amount</th>
            <th class="text-left">Processing Fee</th>
            <th class="text-left">Assigned To</th>
            <th class="text-left">Assigned Time</th>
            <th class="text-left">Status</th>
            <th class="text-left">Action</th>
        </tr>
    </thead>
    <tbody></tbody>
</table>

结果变为

enter image description here

很合适,没问题。但是,他们没有显示我在数据表中提到的列,仅显示了处理费。

现在我指定所有列

<table id="tableWithdrawalList" class="display responsive nowrap  table table-striped table-lightfont" style="width:100%; border-top:1px solid grey;">
    <thead>
        <tr>
            <th class="all text-left"><input type="checkbox" title="Select all" id="selectedAllRadio" onclick="checkUnCheckAll()" /></th>
            <th class="all text-left">Request Receipt</th>
            <th class="all text-left">Created Date</th>
            <th class="all text-left">Serial Number</th>
            <th class="all text-left">Full Name</th>
            <th class="all text-left">Email</th>
            <th class="all text-left">Amount</th>
            <th class="all text-left">Processing Fee</th>
            <th class="all text-left">Assigned To</th>
            <th class="all text-left">Assigned Time</th>
            <th class="all text-left">Status</th>
            <th class="all text-left">Action</th>
        </tr>
    </thead>
    <tbody></tbody>
</table>

enter image description here 哦,天哪,数据表没有响应就跨面板显示,如何显示响应式所有列?

1 个答案:

答案 0 :(得分:1)

如果您想显示所有列,我想您可以尝试调整单个列的宽度以使其很好地适合。另外,将此css属性table-layout:fixed;添加到#tableWithdrawalList,以强制在表中插入文本。

希望有帮助。