export data in pdf

export data in pdf

I populate data in table through jquery now i want to export that data in pdf /excel For this I try this link export data link  link

I try this work successfully then i this code add in my file

  1. <a href="#" onclick="$('#tabledata').tableExport({ type: 'excel', escape: 'false' });">XLS</a>

  2. <a href="#" onclick="$('#tabledata').tableExport({ type: 'pdf', escape: 'false' });">PDF</a>
I create table with the help pf jquery

  1.  success: function (result) {
  2.              var final = JSON.parse(result.d).response;

  3.              console.log(JSON.parse(result.d).response);
  4.              $("#tabledata").empty();

  5.              if (final.length > 0) {
  6.                  $("#tabledata").append(
  7.           "<tr><th>ID</th><th>Owner</th><th>RegNo</th></tr>");

  8.                  for (var i = 0; i < final.length; i++) {

  9.                      if (final[i] !== null) {
  10.                          $("#tabledata").append("<tbody><tr><td>" +
  11.                                              final[i][0] + "</td> <td>" +
  12.                                              final[i][1] + "</td> <td>" +
  13.                                              final[i][2] + "</td></tr></tbody>");

  14.                      }
  15.                  }
  16.                  $("#tabledata tr:first").addClass('GridviewScrollHeader');
  17.                  $("#tabledata tr").addClass('GridviewScrollItem');
  18.                  $("#tabledata").addClass('GridviewScrollPager');

  19.              }
ok now this get data with header also but now the problem is there is only two columns display in pdf third column is not display i think because of formatting check image 



so how i done this