-3

I have three tables with different columns. I want to export those three tables to single pdf.

<table>
 <thead><th>test header</th></thead>
 <tbody><td>test</td></tbody>
</table>
RonyLoud
  • 2,408
  • 2
  • 20
  • 25

2 Answers2

0

Using jspdf Yo can export multiple tables to single pdf

Demo

JS need to add

http://cdnjs.cloudflare.com/ajax/libs/jspdf/0.9.0rc1/jspdf.min.js

HTML

<div id="content">
     <table><thead><th>test header</th></thead>
 <tbody><td>test</td></tbody>
</table>
</div>
<div id="editor"></div>
<button id="cmd">generate PDF</button>

Script

var doc = new jsPDF();
var specialElementHandlers = {
    '#editor': function (element, renderer) {
        return true;
    }
};

$('#cmd').click(function () {
    doc.fromHTML($('#content').html(), 15, 15, {
        'width': 170,
            'elementHandlers': specialElementHandlers
    });
    doc.save('sample-file.pdf');
});
Karan Singh
  • 876
  • 1
  • 6
  • 12
-3

Simple way is that,

  1. COPY and PASTE tables content from Browser to MS-Word
  2. Do proper alignment of the content
  3. Save this .doc file by selecting 'SAVE As Type' - PDF(*.pdf)
  4. there you will get required pdf file.
Pengyy
  • 37,383
  • 15
  • 83
  • 73
Vzy
  • 1
  • 2