gpt4 book ai didi

html - 显示 : block squeezing table

转载 作者:太空宇宙 更新时间:2023-11-04 06:27:12 25 4
gpt4 key购买 nike

我创建了一个包含一些数据的表,当我添加 display: block 时我收到一个错误,我使用在堆栈上找到的解决方案修复了这个错误-溢出即<tr> squeezed when <tbody> is display:block .然而,这给了我另一个显示错误,使我的表格上的第一列宽度为 100%,而其他列则被挤压。

如有任何关于我如何解决此问题的建议/帮助,我们将不胜感激。

表格的外观;

enter image description here

    #requestContents tr{
page-break-inside: avoid !important;
}

#requestContents td{
width: 100% !important;
}
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css"> 
<table class="table table-bordered table-condensed" id="requestContents" style="display: block; height: 250px; overflow-y: scroll">
<thead>
<tr>
<th>Request ID</th>
<th>Request Type</th>
<th>Blood Type</th>
<th>Notice</th>
<th>Request Date</th>
</tr>
</thead>
<tbody>
<tr>
<td>Dummy Dat</td>
<td>Dummy Data</td>
<td>Dummy Data</td>
<td>Dummy Data</td>
<td>Dummy Data</td>
</tr>
<tr>
<td>Dummy Data</td>
<td>Dummy Data</td>
<td>Dummy Data</td>
<td>Dummy Data</td>
<td>Dummy Data</td>
</tr>
<tr>
<td>Dummy Data</td>
<td>Dummy Data</td>
<td>Dummy Data</td>
<td>Dummy Data</td>
<td>Dummy Data</td>
</tr>
</tbody>
</table>

最佳答案

    #requestContents thead,#requestContents tbody{
display:table; width:100%;

}
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css"> 
<table class="table table-bordered table-condensed" id="requestContents" style="display: block; height: 90px; overflow-y: scroll">
<thead>
<tr>
<th width="20%">Request ID</th>
<th width="20%">Request Type</th>
<th width="20%">Blood Type</th>
<th width="20%">Notice</th>
<th width="20%">Request Date</th>
</tr>
</thead>
<tbody>
<tr>
<td>Dummy Dat</td>
<td>Dummy Data</td>
<td>Dummy Data</td>
<td>Dummy Data</td>
<td>Dummy Data</td>
</tr>
<tr>
<td>Dummy Data</td>
<td>Dummy Data</td>
<td>Dummy Data</td>
<td>Dummy Data</td>
<td>Dummy Data</td>
</tr>
<tr>
<td>Dummy Data</td>
<td>Dummy Data</td>
<td>Dummy Data</td>
<td>Dummy Data</td>
<td>Dummy Data</td>
</tr>
</tbody>
</table>

关于html - 显示 : block squeezing table,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54970062/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com