【发布时间】:2019-11-13 02:09:55
【问题描述】:
我希望thead 在表格中滚动时不要移动,我无法在 tbody 上设置溢出自动,那么我该如何解决?
我已经尝试过 style="overflow: auto; height: 650px;"在 tbody 上,但它甚至根本不起作用
<div class="row m-t-30">
<div style="overflow: auto; height: 650px;" class="col-md-12">
<div class="table-responsive m-b-40">
<table id="productsTable" class="table table-borderless table-data3">
<thead>
<tr>
<th>Klant</th>
<th>Werknemer</th>
<th>Datum</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
foreach ($clients->getAllclients() as $client) {
echo '<tr>';
echo '<td>' . $client['client_name'] . '</td>';
echo '<td>' . $client['client_id'] . '</td>';
echo '<td>' . $client['client_address'] . '</td>';
echo '<td><button class="item" data-toggle="tooltip" data-placement="top" title="See" onclick="seeOrder(\'' . $client['client_id'] . '\')"><i style="font-size: 20px" class="zmdi zmdi-search"></i></button></td>';
echo '</tr>';
}
?>
</tbody>
</table>
</div>
</div>
</div>
【问题讨论】:
标签: php html css html-table datatable