If one of the properties is an object then you need to account for that. I did visit the URL you provided and can see that the
"products"
property is an array of products, which you won't easily be able to populate into the table directly.
I'd recommend being more explicit when you're building your table. Instead of iterating over each of the properties in the JSON, structure your table so it uses specific properties:
function createCell(tr, value) {
const cell = document.createElement('td');
cell.textContent = value;
tr.appendChild(cell);
}
for (const row of data) {
const tr = document.createElement('tr');
createCell(tr, row.orderid);
createCell(tr, row.customerid);
tableBody.appendChild(tr);
}
If you want to access the products array then you need to do so explicitly:
for (const row of data) {
for (const product of row.products) {
}
}