Question

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);
            })
        })
Était-ce utile?

La solution

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

tab

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top