我使用laravel创建了一个联系页面,这是我的查看代码:
<table id="example">
<thead>
<tr>
<th class="no-sort"></th>
</tr>
</thead>
<tbody>
<?php $idx = 1; ?>
@foreach($users as $result)
@if($idx == 1) <tr> @endif
<td class="col-md-4 col-sm-4 col-xs-12 animated fadeInDown">
<div class="well profile_view">
<div class="col-sm-12">
<h4 class="brief"><i>Digital Strategist</i></h4>
<div class="left col-xs-7">
<h2>{!! $result->first_name !!}</h2>
<p><strong>Username: </strong> {!! $idx !!} </p>
<ul class="list-unstyled">
<li>{!! $result->email !!}</li>
</ul>
</div>
<div class="right col-xs-5 text-center">
@if($result->image)
{!! Html::image('packages/calibre/images/profile/'.$result->image, '', array("class"=>"img-circle img-responsive")) !!}
@else
{!! Html::image('packages/calibre/images/profile/none.png', '', array("class"=>"img-circle img-responsive")) !!}
@endif
</div>
</div>
<div class="col-xs-12 bottom text-center">
<div class="col-xs-12 col-sm-12 emphasis">
<button type="button" class="btn btn-success btn-xs pull-left"><i class="fa fa-check"></i> Active</button>
<button type="button" class="btn btn-primary btn-xs pull-right"><i class="fa fa-search"></i> View Profile </button>
</div>
</div>
</div>
</td>
@if($idx == 3) </tr> @endif
<?php if($idx == 3) $idx = 1; else $idx++; ?>
@endforeach
</tbody>
</table>
布局与普通表格不同,它使用了标签模板。
如何使用DataTables进行搜索和分页?有谁可以帮助我?