bootstrap table怎么添加行号?
使用bootstrap table,怎么添加行号呢?1,2,3....而不是从数据库中查出来的表id数据。求大神们给解答下。
<table id="titleTable"
data-toggle="table"
data-url="/template/querylist.html"
data-pagination="true"
data-side-pagination="server"
data-page-list="[10, 20]"
data-search="false"
data-query-params="queryParams"
data-height="700">
<thead>
<tr>
<th data-field="id" data-align="center">编号</th>
<th data-field="name" data-align="center" data-formatter="formatFunc.name">名称</th>
<th data-field="updateTime" data-formatter="formatFunc.updateTime">更新时间</th>
<th data-field="operate" data-formatter="formatFunc.operator">操作</th>
</tr>
</thead>
</table>
<table id="titleTable"
data-toggle="table"
data-url="/template/querylist.html"
data-pagination="true"
data-side-pagination="server"
data-page-list="[10, 20]"
data-search="false"
data-query-params="queryParams"
data-height="700">
<thead>
<tr>
<th data-field="id" data-align="center">编号</th>
<th data-field="name" data-align="center" data-formatter="formatFunc.name">名称</th>
<th data-field="updateTime" data-formatter="formatFunc.updateTime">更新时间</th>
<th data-field="operate" data-formatter="formatFunc.operator">操作</th>
</tr>
</thead>
</table>
1 个回复
Forrest
赞同来自:
{
field: 'Number',
title: 'Number',
formatter: function (value, row, index) {
return index+1;
}
}