我正在尝试显示数据数据表,Tapo有问题,请帮助,对于另一个dicode datatables可以成功运行,但是在这段代码中不想要这条路吗? 未捕获的TypeError:无法读取属性' mData'未定义的
这个JS
<script src="<?php echo base_url('assets/js/jquery.dataTables.min.js') ?>" type="text/javascript"></script>
<script src="<?php echo base_url('assets/js/dataTables.bootstrap.min.js') ?>" type="text/javascript"></script>
<script>
$(document).ready(function() {
$('#files').DataTable();
});
&#13;
table class="table table-striped table-condensed" id="files">
<thead>
<tr>
<th>File Name</th>
<th>Upload By</th>
<th>Upload Date</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
foreach($files as $f => $file){
foreach($permission as $p => $key){
if($key['id_files'] == $file['file_id'] ||$this->user->is_teacher || $this->user->is_superadmin ){
echo '<tr>';
echo '<td><a href="'.base_url('dropzone/global_download')."/".$file['file_id'].'">'.$file['file_name'].'</a></td>';
echo '<td>'.$file['upload_by'].'</td>';
echo '<td>'.date("d-M-Y",strtotime($file['upload_dt'])).'</td>';
echo '<td>';
if($this->user->is_teacher || $this->user->is_superadmin){
echo '<a href="'.base_url('dashboard/permission_file')."/".$file['file_id'].'"><i class="fa fa-user"></i> Manage </a>';
echo '</td>';
echo '<td>';
echo '<a href="javascript:_delete_file('.$file['file_id'].');"><i class="fa fa-times"></i> Delete </a>';
}
echo '</td>';
echo '</tr>';
}
}
}
?>
</tbody>
</table>
&#13;