+ 1
Create a table using JS
I'm trying to create a table with JavaScript, where every table cell has a unique id. How would I do this, I've tried but failed.... Please help me
6 odpowiedzi
+ 4
Your issue was trying to modify the DOM prior to it loading.
https://code.sololearn.com/Wji67RUSYw66
+ 7
The best method to get help is link your code. That allows us to see what you are doing and fix it. Instead of guessing and providing something that is useless to you.
+ 6
I'm filling out a table in this code.
https://code.sololearn.com/W0SpGiJ3Vfzb
The empty table is in the HTML. The rows and columns are added in the JavaScript.
+ 5
row 1 column 1 id matches row 11 id. Stick a letter in to make them unique. Updated mine to r11 for row c11 for cell.
0
John Wells Here you go:
https://code.sololearn.com/W1kw1OVKWeqJ/?ref=app
So what I want to do is:
Create an empty table
Use a for loop and jQuery to add rows and cells, each row/cell has the id of the for loop's integer (so i/j in my case)
But nothing happens...
0
John Wells But now when I try to make it, say, a 20x20 Table by increasing the max size.of i/j, it looks weird, see my newest "share anything coding" post to see what I mean...