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>
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>
Using jspdf Yo can export multiple tables to single pdf
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');
});