How to create a tt table table of an html table from an array? For example, when I want “0” to be “td” with a green background and a width and height of 20 pixels, and “1” to be “td” with a brown background with the same size? Can someone give an example for this array? Also, I would like to know how to insert an image into a specific td element? for example, a tree image in the "td" element in the position table [0] [0] with a green background, thanks.
var table = [
[0,1,1,1,0],
[0,1,0,0,0],
[0,1,1,0,0],
[0,0,1,0,0],
[1,1,1,0,0]
]
source
share