0
Is it possible to link cells of the html table to array elements in js?
8 ответов
+ 1
getElementName?
+ 4
Somewhat like this?
It stores all the table cells
https://code.sololearn.com/WEJ30RT9Qsj4/?ref=app
+ 2
Сергей Куликов In case by "too much", you meant too much typing, I have knocked this up to demonstrate that it can be done with JS in under 15 lines.
https://code.sololearn.com/WN3Qx40tpiO6/?ref=app
+ 1
Would it work if you gave each table cell an id - something like id="td_x_y" where x and y are the row coordinate and column coordinate of your array?
+ 1
Thanks everyone. I did not focus on the topic of creating containers in the course on JS from Sololearn. Now I understand what way to work in.
0
I want to use a two-dimensional JS array to manage the contents of html table cells. Are there any known methods?
Я хочу использовать двумерный массив js для управления содержимым ячеек html таблицы. Существуют ли какие-либо известные способы?
0
njay, thanks for the tip. I think getElementsByTagName will work in my case. However, the problem is complicated by a two-dimensional array. I need to practice.
0
Russ, I have a table 15x15 cells, it is too much to give an id to each.