jperry1147
jperry1147

Reputation: 276

jspdf fromHTML table style

I am using jspdf to convert a webpage into a pdf document and I have the from_html plugin included. It converts all the tables in my document and everything is fine except I would really like to change the way to tables look. They all have a dark grey head and the text is bold and too large. I can't work out how to change them.

Things I have tried:

Can anyone tell me what I haven't tried or if this is even possible please? All of the demos of tables made with jspdf seem to look the same as mine but I would really like to change it.

Thank you!

James

Upvotes: 1

Views: 2646

Answers (1)

Villager
Villager

Reputation: 604

You have tried:

  • Setting the color and size inside the td tag

Unfortunately jsPDF doesn't seem to support CSS - see this answer.

  • Changing the doc.table_font_size to a smaller number before doc.save

Have you tried using doc.setFontSize(size)?

  • Searching through the js files to try to find where they are set

Here is the debug file - much handier to search through.

I know this isn't a direct solution to what you're trying to do, but I hope it helps a little bit - I just started learning how to use jsPDF too, but I'm building tables from scratch rather than trying to export them from the HTML.

Upvotes: 0

Related Questions