Reputation: 109
I am trying to create an invoice using jspdf-autotable
. I want to address a long address that will wrap properly while maintaining overflow:hidden
.
In this fiddle I added
bodyStyles: { valign: "top" },
styles: { overflow: "hidden", cellWidth: "wrap" },
columnStyles: { text: { cellWidth: "auto" } },
which merges the address text with the right table
And in this fiddle I just kept overflow:hidden
which keeps the gap between the two adjacent tables but crops the address text.
QTY
, Price
, Amount
?Upvotes: 2
Views: 4686
Reputation: 2587
If you want the address to wrap probably into multiple line, you need to remove the overflow: "hidden"
and the cellWidth: "wrap"
styles, "warp"
here actually means not to wrap and put it in one line only, so you need to remove both styles, you may also want to set minCellWidth
to caption fields.
for question number 2, you can specify right align to specific columns like this columnStyles: {2: {halign: 'right'}, 3: {halign: 'right'}}
Upvotes: 2