adhik13th
3 months ago

How to limit data 10 per page on table jspdf autotable

Posted 3 months ago by adhik13th

I want to limit only 10 data perpage on jspdf ,only 10 rows data on 1 page , but didnt work .

i always use this autoTableAddPage , but its didnt work , i references from this link ,

and its my code

 var res = doc.autoTableHtmlToJson(document.getElementById("basic-table"));     
  doc.autoTable(res.columns, res.data, {
     drawRow: function(row) {
        if (row.index > 0 && row.index % 10 === 0) {
           doc.autoTableAddPage();
         }
       }
  }, {margin: {top: 180},beforePageContent: header });

this data is showing but always more than 10 rows , whats wrong with this ? can someone help ?

Please sign in or create an account to participate in this conversation.