gpt4 book ai didi

jquery - 可滚动表格不同宽度列

转载 作者:行者123 更新时间:2023-11-28 01:06:58 25 4
gpt4 key购买 nike

谁能帮帮我?我有一张 table here is my table ,我希望这个表格变得可滚动,我在谷歌上搜索但列是相同宽度 here这里我的列是不同的宽度

这是我改变大小的列,因为这是我的风格

.scrollTable thead {
display: block;}

.scrollTable tbody {
display: block;
height: 320px;
overflow: auto;}

这是我的HTML代码

  <table class="scrollTable" width="100%" >
<thead>
<tr id="notclickable">
<th width="3%" class="table-conf header-table">Order No. </th>
<th width="10%" class="table-conf header-table">Latest No</th>
<th width="20%" class="table-conf header-table">Parts Name</th>
<th width="7%" class="table-conf header-table">Qty</th>
<th width="8%" class="table-conf header-table">Unit Price</th>
<th width="10%" class="table-conf header-table">Amount</th>
</tr>
</thead>
<tbody>
<?php
for ($i=0; $i < 15; $i++) :
?>
<tr>
<td class="table-conf <?= ($i % 2 == 0 ) ? "even" : "odd" ; ?>"><br>ganteng</td>
<td class="table-conf <?= ($i % 2 == 0 ) ? "even" : "odd" ; ?>"><br>ganteng</td>
<td class="table-conf <?= ($i % 2 == 0 ) ? "even" : "odd" ; ?>"><br>ganteng</td>
<td class="table-conf <?= ($i % 2 == 0 ) ? "even" : "odd" ; ?>"><br>ganteng</td>
<td class="table-conf <?= ($i % 2 == 0 ) ? "even" : "odd" ; ?>"><br>ganteng</td>
<td class="table-conf <?= ($i % 2 == 0 ) ? "even" : "odd" ; ?>"><br>ganteng</td>
</tr>
<?php endfor; ?>
<!-- //sek2 engkok lek bingung tak takok kon maneh iki takcobak plek karo ndk conto -->
</tbody>
</table>

最佳答案

使用 width:100%table-layout:fixed; 之类的,

.scrollTable thead {
display: block;
}
.scrollTable tbody tr {
table-layout:fixed;
display:table;
width:100%;
}
.scrollTable tbody {
display:block;
height:50px;
overflow:auto;
width:100%;
}

Demo

关于jquery - 可滚动表格不同宽度列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52308238/

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