Issue
Error TS2339 - Property 'rows' does not exist on type HTMLElement when looping through table in Angular 7
Encountering error when trying to loop through HTML table in Angular 7
Currently working with Angular 7 and facing an error while looping through a table in the HTML code
ERROR in src/app/Pages/part-compare/part-compare.component.ts(25,38):
error TS2339: Property 'rows' does not exist on type 'HTMLElement'.
src/app/Pages/part-compare/part-compare.component.ts(27,26): error TS2339:
Property 'rows' does not exist on type 'HTMLElement'.
Need help solving this error. Any suggestions?
Things I have attempted:
var table = document.getElementById("CompareParts");
for (var i = 1, row; row = table.rows[i]; i++) {
for (var j = 0, col; col = row.cells[j]; j++) {
var Cell = table.rows[i].cells
this.ACells.push(Cell);
}
}
this.length=this.ACells.length
for (var x = 0; x < this.ACells.length; x++) {
this.ARows.push(this.ACells[x]);