【发布时间】:2018-09-13 07:01:29
【问题描述】:
任何人都可以帮助我吗?我有一个表here is my table,我希望这个表可以滚动,我在谷歌上搜索,但列是same widthhere,这里我的列是different width。
这是我的专栏正在改变大小,因为这是我的风格
.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>
【问题讨论】:
-
嗨,用 jsfiddle 或 codepen 模拟问题
标签: jquery html css codeigniter scrollable-table