I have created a variable in javascript (assume named it as tableDetail) of type string which contains html tags.
for example
var tableDetail = “<table>”;
…some code
tableDetail += “<tr>”
For loop{
// logic to create dynamic tables column
tableDetail += “<th>column_data</th>”
}
tableDetail += “<tr>”
some more loops {
// for each rows - data creation
tableDetail += “<td>row_data</td>”
}
tableDetail += “</tr></table>”
and at the end of all loops, I am getting entire string in tableDetail variable which contains table tag + data. Below is the code that i get when i hover on variable in debugging mode(inspect element)
"<table width='100%' border='1' cellspacing='0'><tr><th>CurrencyCode</th></tr><tr><td>EUR</td></tr>………"
So, by using tableDetail variable I want to create a PDF on a button click in javascript.
Is it possible? and How can I achieve this?
Thanking you in advance.