虚拟社区

程序开发 => WEB前端开发 => 主题发帖人为: jvip_chen 于 2022-4月-20 06:46 上午

标题: DataTable新增序号列 自增
作者: jvip_chen2022-4月-20 06:46 上午
切换分页也自动叠加序号
{
  "data": "no",
    orderable : false,
    className: "text-center", //居中显示
    title: "序号", //表头
    render: function (data, type, row, meta) {
        return meta.row + 1 + meta.settings._iDisplayStart; //切换分页序号 也自动叠加
      //return meta.row + 1 ; //每页序号重新排序
    }
},