var myarray=new Array(4)
for (i=3; i <7; i++) myarray[i]=new Array(8);  

for (i=3;i<7;i++) {
	for (j=1;j<9;j++) {
		if (document.getElementById('mytable').rows[i].cells[j]!=null) {
myarray[i][j]=document.getElementsById('mytable').rows[i].cells[j].innerHTML;}
		else myarray[i][j]=0;

	}
}

Here is my code and i want to check if the cell exist and if it is true to take the content of the cell. But it gives me an error in the 6 line(which i believe is wrong):

Message: Object doesn't support this property or method

Recommended Answers

All 2 Replies

See http://www.daniweb.com/forums/post1204933.html#post1204933

Start the indices at your choice of lower bound (instead of 0) and limit them to less than the corresponding .length (if necessary).

IIRC your table has more than one body; if so, you will have to further modify that code accordingly.

Great! It works! Thank you so much

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.