im new to coding and to this community and i really searched for the answer i wanted but found nothing this specific. So here goes :
i have an array that goes like this :
var arr = new Array();
arr[0]={col1:"john",col2:"is",col3:"a", col4:"fool"};
arr[1]={col1:"paul",col2:"is",col3:"a", col4:"fool"};
arr[2]={col1:"luke",col2:"is",col3:"a", col4:"fool"};
and an HTML table that already exists :
<body>
<Table>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</Table>
</body>
i
function fillTable();
var tr,td,row,tn,col;
for(var row=0;row=arr.length;row++){
tr=document.getElementsByTagName("tr")[i];
for(var col=0;col=arr[row].length;col++){
document.getElementsByTagName("td").innerHTML = arr[row].col;
}
}
ive tried many ways like changeNodeValue, or creating a whole new table but obviously im missing something so im asking you guys. Thanks in advance for the help
arr[row].col
is not a property there.