如何在codeigniter中执行排序、搜索和分页
我是一个新手。我想对我的表进行搜索、排序和分页。 我尽了最大努力。当搜索代码起作用时,排序可能不起作用。我不能在一个表中执行这三个操作。请帮帮我 使用。它还内置了搜索、排序和分页功能如何在codeigniter中执行排序、搜索和分页,codeigniter,sorting,search,pagination,Codeigniter,Sorting,Search,Pagination,我是一个新手。我想对我的表进行搜索、排序和分页。 我尽了最大努力。当搜索代码起作用时,排序可能不起作用。我不能在一个表中执行这三个操作。请帮帮我 使用。它还内置了搜索、排序和分页功能 我的代码示例 在视图中 <div style="clear: both; margin-top: 35px"></div> <div class="container"> <div class="col-sm-12" style="padding: 0px">
我的代码示例 在视图中
<div style="clear: both; margin-top: 35px"></div>
<div class="container">
<div class="col-sm-12" style="padding: 0px">
<div class="row">
<div class="col-sm-10 col-sm-offset-1 " style="padding-right:0px;">
<table id="example" class="table table-striped table-bordered" cellspacing="0" width="100%">
<thead>
<tr>
<th width="20%"></th>
<th width="15%"></th>
<th width="20%"></th>
<th width="15%"></th>
<th width="10%"></th>
</tr>
</thead>
<tbody>
<?
foreach ( $ as $ )
{
?>
<tr>
<td><?php echo $['']?></td>
<td><?php echo $['']?></td>
<td><?php echo $['']?></td>
<td><?php echo $['']?></td>
</tr>
<?
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
在标题中
$data[''] = $this->model_name->function_name();
<link href="<?php echo base_url(); ?>css/bootstrap.css" rel="stylesheet" />
<link href="<?php echo base_url(); ?>css/bootstrap-glyphicons.css" rel="stylesheet" />
<link href="https://cdn.datatables.net/plug-ins/1.10.7/integration/bootstrap/3/dataTables.bootstrap.css" rel="stylesheet" />
使用。它还内置了搜索、排序和分页功能
我的代码示例
在视图中
<div style="clear: both; margin-top: 35px"></div>
<div class="container">
<div class="col-sm-12" style="padding: 0px">
<div class="row">
<div class="col-sm-10 col-sm-offset-1 " style="padding-right:0px;">
<table id="example" class="table table-striped table-bordered" cellspacing="0" width="100%">
<thead>
<tr>
<th width="20%"></th>
<th width="15%"></th>
<th width="20%"></th>
<th width="15%"></th>
<th width="10%"></th>
</tr>
</thead>
<tbody>
<?
foreach ( $ as $ )
{
?>
<tr>
<td><?php echo $['']?></td>
<td><?php echo $['']?></td>
<td><?php echo $['']?></td>
<td><?php echo $['']?></td>
</tr>
<?
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
在标题中
$data[''] = $this->model_name->function_name();
<link href="<?php echo base_url(); ?>css/bootstrap.css" rel="stylesheet" />
<link href="<?php echo base_url(); ?>css/bootstrap-glyphicons.css" rel="stylesheet" />
<link href="https://cdn.datatables.net/plug-ins/1.10.7/integration/bootstrap/3/dataTables.bootstrap.css" rel="stylesheet" />
阅读本教程阅读本教程@Abdulla yeah。。这真的很有帮助。:)@SaranyaR很乐意帮忙:)享受Coding@SaranyaR这也添加了这个引导glyphicons.css
。可以在bootstrap网站@Abdulla yeah.下载。。这真的很有帮助。:)@SaranyaR很乐意帮忙:)享受Coding@SaranyaR这也添加了这个引导glyphicons.css
。可以在引导网站上下载