【发布时间】:2019-11-09 01:35:28
【问题描述】:
目前我正在使用动态数据表 bootstrap 4,我想在我的表中添加分页
查看:
<form role="form">
<div class="card-body">
<div class="row">
<table id="example1" class="table table-bordered table-striped table-sm" >
<thead>
<tr>
<th>Bilty Id</th>
<th>LR No</th>
<th>Consignor Name</th>
<th>Consignor Gst No</th>
</tr>
</thead>
<tbody>
<?php foreach($bilties as $bilty){?>
<tr>
<td><?php echo $bilty->id;?></td>
<td><?php echo $bilty->lr_no;?></td>
<td><?php echo $bilty->consignor;?></td>
<td><?php echo $bilty->consignor_gst_no;?></td>
</tr>
<?php }?>
</tbody>
</table>
</div>
</div>
</form>
控制器:
public function viewBilty(){
$this->load->view('template/header');
$this->load->view('template/sidebar');
$data= array();
$this->data['bilties'] = $this->biltyModel->viewBilty();
$this->load->view('booking/bilty/viewbilty',$this->data);
$this->load->view('template/footer');
}
型号:
public function viewEnableBilty($userid){
$this->db->select('*');
$this->db->from('bilty');
$this->db->where('b.status', 'active');
$query = $this->db->get();
return $query->result();
}
这是我的模型视图控制器我有动态数据表,我想为这个表添加分页
【问题讨论】:
-
你必须尝试一下。你可以从这里开始:github.com/IgnitedDatatables/Ignited-Datatables
标签: jquery mysql sql ajax codeigniter