Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Use jspdf as formatted table

Saddam HossainSaddam Hossain Posts: 1

I am using jspdf for make a table as pdf when user click a button.Pdf makes successfully but data is not formatted as table.

my code

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

$('#gen_pdf').click(function () {
doc.fromHTML($('#make_pdf').html(), 15, 15, {
'width': 170,

    'elementHandlers': specialElementHandlers
});
doc.save('student_result.pdf');

});

and table

<div class="form-group" id="make_pdf">
                    <table id="tbl" class="table table-bordered">
                        <tbody>
                        <td>Course Code</td>
                        <td>Name</td>
                        <td>Grade</td>

                        </tbody>
                    </table>
                </div>
Sign In or Register to comment.