I'm having a problem in correctly displaying the number of rows in the table.
In particular, rowCount is always equal to 1.
Can anyone kindly help me?
let table = document.getElementById("my-table");
allart.Items.forEach(function (item) {
let child = document.createElement("tr");
child.innerHTML = `
<td>${item.id}</td>
<td>${item.title}</a></td>
<td>${item.brand}</td>
table.appendChild(child);
}
var table = document.getElementById(my-table).tBodies[0];
var rowCount = table.rows.length;
<table id = "my-table" width = "90%">
<tr>
<th> Id </th>
<th> Title </th>
<th> Brand </th>
</tr>
</table>
Regarding the javascript code, I only put the code of interest because the whole code is too long