How to select second page as initial page with jQuery datatable

前端 未结 3 1094
不思量自难忘°
不思量自难忘° 2021-01-18 22:04

I am using jQuery datatable.By default it is showing first page as initial page .But i want to show the second page as default page.When i am using YUI data table .In that

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-18 22:39

    With version 1.10 of DataTables there is a displayStart option that will allow you to set the default page.

    Note that the displayStart value is a zero based count of records, not pages. If you have 10 records per page, displayStart: 10 will show page 2

    $('#my-datatable').DataTable( {
      'displayStart': 10
    } );
    

    https://datatables.net/reference/option/displayStart

提交回复
热议问题