Reputation: 1205
I am trying to render a table using jsPDF and I used this code from here but the problem is if the text is bigger than the cell borders, it goes outside the cell. Is there an easy way to make the text truncate or make the cell bigger in height to fit all the text inside ?
$.each(table, function (i, row){
console.debug(row);
$.each(row, function (j, cell){
doc.cell(10, 50,120, 50, cell, i);
})
})
Upvotes: 1
Views: 3522
Reputation: 8151
I found that the support for tables overall is lacking in jsPDF so I made a plugin. It features truncate of text if the column widths exceeds the page width among other things. Check it out! jspdf-AutoTable
Upvotes: 2