jsPDF autoTable columnWidth wrap cuts table off
See original GitHub issueI am using jsPDF to generate a PDF from an HTML table and jsPDF is great, expect I am having one issue, when I try to wrap the columnWidth, my table gets cut off 😦
var doc = new jsPDF('l', 'mm', "a0");
var tbl = $('#cost-matrix-table').clone();
tbl.find('tr:nth-child(1)').remove();
tbl.find('tr:nth-child(1)').remove();
tbl.find('tr:nth-child(2)').remove();
var res = doc.autoTableHtmlToJson(tbl.get(0));
doc.autoTable(res.columns, res.data, {
startY: 40,
margin: {
top: 40
},
addPageContent: function (data) {
doc.setFontSize(28);
doc.setTextColor(0);
doc.setFontStyle('bold');
doc.text("Cost Matrix " + $("#dropdown").val(), 500, 30);
},
styles: {
fontSize: 20,
overflow: 'linebreak',
columnWidth: 'wrap',
},
theme: 'grid'
});
doc.save("Report.pdf");
Is there a solution for this?
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (2 by maintainers)
Top Results From Across the Web
jsPDF autoTable columnWidth wrap cuts table off
Replace your autotable creation part into below code doc.autoTable(res.columns, res.data, { startY: 40, margin: { top: 40 }, addPageContent: ...
Read more >jsPDF autoTable columnWidth wrap cuts table off
I am using jsPDF to generate a PDF from an HTML table and jsPDF is great, expect I am having one issue, when...
Read more >Developers - jsPDF autoTable columnWidth wrap cuts table off
I'm trying do to a pagination with jspdf - autotable . But i dont know how to get total number of pages ....
Read more >Jquery – How to fit a jspdf autotable in a pdf document
jqueryjspdf. I am trying to fit a table in a pdf using jspdf autotable plugin but for some reason the text in the...
Read more >How to fit the field text to the column width of a... - ServiceNow
We have a UI Page which creates a PDF document. The PDF contains a table which populates data from the table within Service...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The code looks for numbers, it was enough to remove the ‘’. ‘107’ → 107
how I can set the single row height according to the image height in the table?