0

I am trying to loop through tables inside of tables in Javascript. Insteadof the person using rows and columns. They have done tables inside tables.

So I am trying to loop through tables which contain an ID of table-1000. Then loop through the defination of the table which have a value of apple.

Then dsiplay the indxes.

So far I have done the following:

var table = document.getElementById("table") //getting the parent table 

for (var i = 0, row; row = table.rows[i]; i++) {


}

Can someone please help. I am still a beginner at coding. Any help is appreciated. Thanks.

Terry
  • 48,492
  • 9
  • 72
  • 91
Bobs
  • 9
  • 2
  • 2
    It's not very clear. Can you provide the input and output? – ABGR Jun 04 '20 at 10:03
  • 1
    Does this answer your question? [How do I iterate through table rows and cells in JavaScript?](https://stackoverflow.com/questions/3065342/how-do-i-iterate-through-table-rows-and-cells-in-javascript) – guijob Jun 04 '20 at 10:04
  • Get a collection of the nested tables using `document.querySelectorAll('#table table')`, then you can search the cells in the nested tables. – Teemu Jun 04 '20 at 10:04

0 Answers0