I have a div
which contains some data and a table
. The problem I'm facing now is that jspdf
is ignoring the second column of the table and only printing the first column of each row. The following is the HTML and JS
<div id="myDiv">
<p id="bypassme">Some text</p>
<p>Some more text</p>
<table>
<tr>
<td>First</td>
<td>Second</td>
</tr>
<tr>
<td>Third</td>
<td>Fourth</td>
</tr>
</table>
</div>
<script type="text/javascript">
var doc = new jsPDF('p', 'pt', 'letter');
var html = $('#myDiv').html();
var specialElementHandlers = {
'#bypassme': function(element, renderer){
return true;
}
};
doc.fromHTML(html,10,10, {
'width': 500,
'elementHandlers': specialElementHandlers
});
doc.save("Test.pdf");
</script>
What is seen on page:
Some text
Some more text
+-------+--------+
| First | Second |
+-------+--------+
| Third | Fourth |
+-------+--------+
Actual output
Some more text
First
Third
Expected output
Some more text
First Second
Third Fourth