...

View Full Version : Copy A Table To An Array!



scriptkeeper
10-02-2003, 02:51 AM
Hello everyone I was just try to copy the contents of a table and put it in a multidimentional array! But for some reason it keeps rewritting over each time only returning one row! I just cant figure out what I am doing wrong its probly simple! Any help would be great! ThanX




var tabular=new Array();
function copyTable(){
obj=document.getElementById("theTab" );
for(i=0,j=0;i<obj.rows.length,j<obj.rows(i).cells.length;i++,j++){
tabular[i]=new Array();
tabular[i].push(obj.rows(i).cells(j).innerText);
}
alert(tabular);
}

A1ien51
10-02-2003, 01:38 PM
who taught you this?


for(i=0,j=0;i<obj.rows.length,j<obj.rows(i).cells.length;i++,j++){


try doing something with the following



var tabular=new Array();
for(i=0;i<obj.rows.length;i++){
tabular[i] = new Array();
for(j=0;j<obj.rows(i).cells.length;j++){
tabular[i][j]="blah"
}
}

scriptkeeper
10-02-2003, 04:12 PM
Like I said it is pobly something very simple and stupid anyways thanks for your help it worked perfectly!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum