How to get particular html table contents to write it in pdf using itext

前端 未结 2 617
Happy的楠姐
Happy的楠姐 2020-12-07 06:23

I have used iText to export the table contents to pdf.

Here is my code:

JSP:

<%@ page language=\"java\" contentType=\"text/html; charset=I         


        
2条回答
  •  忘掉有多难
    2020-12-07 06:55

    It's ocorring because of line $("#datatoexport").val($("#customers").html()); where the Jquery method .html retrieve the entire html from the html table. There is not easy way to extract text from a html table, you will need a parse function in jquery like in this post: Getting text from td cells with jQuery

    In adiction, the sample that you post isn't the best form to request a server processing text, look in this How to use Servlets and Ajax?

提交回复
热议问题