Javascript AdminLTE引导-表格搜索栏消失,带有附加<;th>;标签
正在使用AdminLTE,并且表有问题 现成的AdminLTE在其表格式中内置了搜索功能和组织功能。使用PHP弹出一些表数据,一切正常。但是,当我试图扩展到示例页面中内置的5个现有的Javascript AdminLTE引导-表格搜索栏消失,带有附加<;th>;标签,javascript,php,jquery,bootstrap-4,adminlte,Javascript,Php,Jquery,Bootstrap 4,Adminlte,正在使用AdminLTE,并且表有问题 现成的AdminLTE在其表格式中内置了搜索功能和组织功能。使用PHP弹出一些表数据,一切正常。但是,当我试图扩展到示例页面中内置的5个现有的标记之外时,搜索框和组织功能完全消失了,我不知道为什么 下面是示例。任何帮助或指导都将不胜感激。谢谢 这项工作: <section class="content"> <div class="row"> <div class="col-xs-12">
标记之外时,搜索框和组织功能完全消失了,我不知道为什么
下面是示例。任何帮助或指导都将不胜感激。谢谢
这项工作:
<section class="content">
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-header">
<h3 class="box-title">Data Table With Full Features</h3>
</div>
<!-- /.box-header -->
<div class="box-body">
<table id="example1" class="table table-bordered table-striped">
<thead>
<tr>
<th>Label 1</th>
<th>Label 2</th>
<th>Label 3</th>
<th>Label 4</th>
<th>Label 5</th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<?php
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo "<tr>";
echo "<td>".$row["ini"]."</td><td>".$row["INI Name"]."</td><td>".
$row["Email Owner"]."</td><td>".$row["Analyst Build"]."</td><td>".
$row["Data Courier"]."</td><td>".
$row["Change Control"]."</td><td>".$row["Direct build in PRD"]."</td>";
echo "</tr>";
}
} else {
echo "0 results";
}
$conn->close();
?>
</tbody>
<tfoot>
<tr>
<th>Label 1</th>
<th>Label 2</th>
<th>Label 3</th>
<th>Label 4</th>
<th>Label 5</th>
</tr>
</tfoot>
</table>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
还参考了以下
bower\u components/datatables.net/js/jquery.datatables.min.js
这只是一个小问题
搜索和格式化消失了,因为我没有向表头和表尾添加项目,也没有在PHP echo命令中包含该列
在所有三个区域中添加新列修复了该问题。这最终成为一个小问题 搜索和格式化消失了,因为我没有向表头和表尾添加项目,也没有在PHP echo命令中包含该列 在所有三个区域中添加新列修复了该问题
...
<th>Label 1</th>
<th>Label 2</th>
<th>Label 3</th>
<th>Label 4</th>
<th>Label 5</th>
<th>Label 6</th>
...
$(function () {
$('#example1').DataTable()
$('#example2').DataTable({
'paging' : true,
'lengthChange': false,
'searching' : false,
'ordering' : true,
'info' : true,
'autoWidth' : false
})
})