SakthiSureshAnand
SakthiSureshAnand

Reputation: 1362

Not Aligning the data inside a column in pdf generated by using jspdf auto table

I have attached my problem in the below snap , I dont know how to align the data in particular manner inside a column using jspdf-autotable generated pdf. I have a requirement to show the parent step and child step in a column . so In my code I wrote a logic inside drawCell() for every child step, added 10Spaces and print in pdf. Inside drawCell() I got cell.text data in the form of array of Strings. I easily added 10 spaces for every string like below

[" String1"," String2"," String3"," TOOLONG STRING dfhdjhdfd..fsdd..."]

If the String is too long some of the letters are hided at the edge of the row ,jspdf tries to place a every string in the same line ,below image shows the problem I am highlighted in that, Please give me some suggestion I am not getting any Idea How to fix it ..Please bear with my English

Hided some letters at edge of column

Upvotes: 0

Views: 653

Answers (1)

Simon Bengtsson
Simon Bengtsson

Reputation: 8161

Try to use the createdCell hook instead of the drawCell hook to add the spaces. It is executed before the width is calculated.

Upvotes: 2

Related Questions