问题描述
我使用 DataTables 来显示我的数据。问题是并非所有数据都显示在表上。例如,当我第一次插入数据时,它不显示数据。但在我插入第二个数据后,它只会显示第二个数据。它应该显示 2 行数据,但它只显示第二行数据。不显示第一行数据。这是我的桌子:
<div class="table-responsive">
<table id="order" class="table ">
<thead>
<tr>
<th>Order No</th>
<th>Order Details</th>
<th>Date Purchased</th>
<th>Time Purchased</th>
<th>Total(RM)</th>
<th>Status</th>
</tr>
</thead>
<?PHP
$no = 0;
while($row3 = MysqLi_fetch_array($result3)){
echo '
<tr>
<td>'.$row3["order_no"].'</td>
<td>'." <a class='btn btn-primary' href='o-details.PHP?order_no=" .$row3['order_no']. "' >Order Details</a> ". '</td>
<td>'.$row3["date"].'</td>
<td>'.$row3["time"].'</td>
<td>'.$row3["total"].'</td>
<td>'."<span class='badge badge-primary'>".$row3["order_status"]."</span>".'</td>
</tr>
';
}
?>
</table>
这是我的js
<script>
$(document).ready(function(){
$('#order').DataTable({
"pagingType": "full_numbers","scrollY": "100vh","scrollCollapse": "true","paging":"false"
});
});
</script>
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)