我无法获得排序图标,分页按钮,搜索表单jQuery数据表适用于PHP MYSQL动态数据。
当没有显示记录时,我可以看到排序图标,Next
和Previous
按钮和搜索表单问题是当有来自MYSQL表的动态数据时
DataTables的HTML部分
<table class="table table-striped table-bordered table-hover" id="dataTables-example">
<thead>
<tr>
<th>Brand Name</th>
<th>Size</th>
<th>SW</th>
<th>OD</th>
</tr>
</thead>
<tbody>
//这是用于显示记录的PHP代码
$record = mysqli_query($con,"SELECT * FROM table_name ORDER BY Manufacturer");
while ($row = mysqli_fetch_array($record)) {
if($row['RC']!="" && $row['SW']!="")
{
if($ag=="" && $size1=="" && $size=="" && $lcc=="" && $scc=="" && $smallsw=="" && $largesw=="" && $smallrc=="" && $largerc=="" && $txtsize=="" && $small== "" && $large == "")
{
}
elseif ($row['Tread_Design']==$R1W)
{
echo "<tr>";
//echo "<td style=' width:300px;text-align:left; padding-left: 10px;vertical-align: middle;'>";echo $row['Manufacturer'];echo"</td>";
echo "<td style=' width:150px; text-align:left; padding: 10px;vertical-align: middle;'>";echo $row['Brand_Name'];echo"</td>";
echo "<td style='width:110px; text-align:left; vertical-align: middle;'>";echo $row['Tire_Size'];"</td>";
echo "<td style='width:100px; text-align:left; vertical-align: middle;'>";echo $row['SW'];"</td>";
echo "<td style='width:100px; text-align:left;vertical-align: middle;'>";echo $row['OD'];"</td>";
echo '</tr>';
} } ......
这是JS代码
<script>
$(document).ready(function() {
$('#dataTables-example').DataTable({
responsive: true,
bPaginate: true,
});
});
</script>