I am filling an html table with Javascript arrays. But I am unable to display this table on the page. What can I do to display this table? Also, let me know if anything is wrong with my function.
Here is my code
function resultTable(arr1, arr2, arr3) {
var result = "<table id='Result' border=1>";
result += "<tr>";
result += "<th>"+Name+"</th>";
result += "<th>"+Score+"</th>";
result += "<th>"+Grade+"</th>";
result += "</tr>";
for(var i=0; i<10; i++) {
result += "<tr>";
result += "<td>"+arr1[i]+"</td>";
result += "<td>"+arr2[i]+"</td>";
result += "<td>"+arr3[i]+"</td>";
result += "</tr>";
}
result += "</table>";
return result;
}
var table = resultTable(names, score, grade);