I want to retrieve every 3 elements in rows and push it in another array. for Ex:retrieve array index
[0,1,2]
[1,2,3]
[2,3,4]
[5,6,7]
[8,9,10] it goes on like this for all rows. Can someone help?
function drawTable() {
var div_id = document.getElementById('div1');
var tbl = document.createElement("table");
tbl.setAttribute("id","table_id") ;
tbl.setAttribute("border","1") ;
div_id.appendChild(tbl);
var tabl_id = document.getElementById("table_id");
for(var i=0;i<5;i++){
var row=document.createElement('tr');
totalRows[i]= new Array();
for(var j=0;j<10;j++){
var cell=document.createElement('td');
cell.setAttribute("width","100px") ;
cell.setAttribute("height","35px") ;
cell.innerHTML = " "+j;
row.appendChild(cell);
}
tabl_id.appendChild(row);
}
}