1. 程式人生 > >layui table中新增一列序號列

layui table中新增一列序號列

頁面檔案在相應的位置上新增下面兩個模組的程式碼:

第一模組:在render table 時新增:

{ field: 'rank', title: '序號', width: 80, sort: true, fixed: 'left', templet: '#rank' }

第二模組:在<script></script>一對標籤外面新增:

<script type="text/html" id="rank">
{{d.LAY_TABLE_INDEX+1}}
</script>

註釋:頁面檔案可以有多個<script></script>標籤.