var cell 10 var row 10 function createDOM var div document getElementB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
var cell = 10;
var row = 10;
function createDOM() {
var div = document.getElementById('d');
var table = document.createElement('table');
for(var i = 0; i < row; i++){
var tr = document.createElement('tr');
table.appendChild(tr);
for(var j = 0; j < cell; j++){
var td = document.createElement('td');
td.innerHTML = i + '<sup>' + j + '</sup>';
tr.appendChild(td);
}
}
div.appendChild(table);
}