How to Generate 3x3 HTML Table From an JavaScript Array -


i have array of values in javascript follows:

var data = {"a", "b", "c", "d", "e", "f", "g", "h", "i" }; 

how can generate 3x3 html table following

a    b    c  d    e    f  g    h    

var data = ["a", "b", "c", "d", "e", "f", "g", "h", "i" ]; // corrected array syntax  var table = document.createelement("table"); var = 0; (var r = 0; r < 3; r++) {   var row = table.insertrow(-1);   (var c = 0; c < 3; c++) {     var cell = row.insertcell(-1);     cell.appendchild(document.createtextnode(data[i++]));   } }  document.body.appendchild(table); 

Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -