How do I export the tables in HTML page to PDF. I have done some sample data but I am unable to load the HTML table list into PDF, Please can any one help me in loading the Tables into PDF.
html2canvas example Hello, this is a H3 tag
Upload to Imgur this is bold red
Header 1 Header 2 row 1, cell 1 row 1, cell 2 row 2, cell 1 row 2, cell 2
5,214 4 4 gold badges 27 27 silver badges 41 41 bronze badges
asked Nov 6, 2013 at 9:09
1,680 11 11 gold badges 33 33 silver badges 59 59 bronze badges
A good option is AutoTable(a Table plugin for jsPDF), it includes themes, rowspan, colspan, extract data from html, works with json, you can also personalize your headers and make them horizontals. Here is a demo.

There is a tablePlugin for jspdf it expects array of objects and displays that data as a table. You can style the text and headers with little changes in the code. It is open source and also has examples for you to get started with.
1,015 2 2 gold badges 15 15 silver badges 21 21 bronze badges answered Jul 28, 2014 at 15:36 Nelli.Prashanth kumar Nelli.Prashanth kumar 61 1 1 silver badge 4 4 bronze badgesHere is an example I think that will help you
Name Email Track S.S.C Roll S.S.C Division H.S.C Roll H.S.C Division District alimon Email 1 2222 as 3333 dd 33
Here the output

Unfortunately it is not possible to do it.
jsPDF does not support exporting images and tables in fromHTML method. in jsPDF v0.9.0 rc2
77 8 8 bronze badges answered Dec 19, 2013 at 15:14 151 3 3 bronze badgesYes, the answer is 'true', but it is not correct to answer this question. OP is asking for help to export to pdf, and has shown an attempt.
Commented Dec 4, 2014 at 15:07"How to properly use jsPDF library" might give you a little more of what you need. The table won't render correctly (no css, per this answer), but you could do some parsing of the html table with jquery and manually style it yourself.
Another option would be to use screenshots of the HTML with HTML2Canvas or Casper.js.
EDIT
Here's a basic example using the jspdf cell plugin. It uses jquery and the tableToJson() function from HTML Table to JSON.
Be sure to include the Deflate lib (two js files) and jspdf.plugin.cell.js .
var table = tableToJson($('#table-id').get(0)) var doc = new jsPDF('p', 'pt', 'a4', true); doc.cellInitialize(); $.each(table, function (i, row)< $.each(row, function (j, cell)< doc.cell(10, 200, 100, 20, cell, i); >) >) doc.save()
1 1 1 silver badge
answered Dec 26, 2013 at 14:53
440 2 2 silver badges 13 13 bronze badges
Just follow these steps i can assure pdf file will be generated
Exporting table data to pdf Example Country State City India Telangana Nirmal India Telangana Nirmal India Telangana Nirmal India Telangana Nirmal India Telangana Nirmal India Telangana Nirmal India Telangana Nirmal

Html file output:

Pdf file output: