jquery plugins —— datatables 增加行号

table = $("#Table").DataTable({
                "rowCallback": function (row, data, dataIndex) {
                    //增加行号
                    $('td:eq(0)', row).html(dataIndex + table.page.info().length * table.page() + 1);
                }});
<table id="Table">
<thead>
      <tr style="text-align:center;">
          <th style="text-align:center;">
          序号
          </th>

      </tr>
</thead>
</table>

 

posted @ 2016-02-26 13:07  小水皮  阅读(716)  评论(0编辑  收藏  举报