如何在同一页面中使用数据表,我使用模板数据表,但是在创建新的一个数据表时不起作用。
这是我的代码
CSS:
<link href="<?php echo base_url();?>/assets/plugins/datatables/jquery.dataTables.min.css" rel="stylesheet" type="text/css"/>
<link href="<?php echo base_url();?>/assets/plugins/datatables/buttons.bootstrap.min.css" rel="stylesheet" type="text/css"/>
<link href="<?php echo base_url();?>/assets/plugins/datatables/responsive.bootstrap.min.css" rel="stylesheet" type="text/css"/>
<link href="<?php echo base_url();?>/assets/plugins/datatables/scroller.bootstrap.min.css" rel="stylesheet" type="text/css"/>
Run Code Online (Sandbox Code Playgroud)
JavaScript:
<!-- Datatable js -->
<script src="<?php echo base_url();?>/assets/plugins/datatables/jquery.dataTables.min.js"></script>
<script src="<?php echo base_url();?>/assets/plugins/datatables/dataTables.bootstrap.js"></script>
<script src="<?php echo base_url();?>/assets/plugins/datatables/dataTables.buttons.min.js"></script>
Run Code Online (Sandbox Code Playgroud)
代码:不,当我用此数据表创建一个新功能时,所有功能均不起作用。
echo "<table id='datatable-buttons' class='table display2 table-striped table-bordered'>";
echo "<thead>";
echo "<tr>";
echo "<th>No.</th>";
echo "<th>Itemset</th>";
echo "<th>Jumlah</th>";
echo"</tr>";
echo "</thead>";
echo "<tbody>";
foreach ($item_array as $ia_key => $ia_value)
{
//$theitems = explode('|',$ia_key);
for($x = 0; …Run Code Online (Sandbox Code Playgroud)