Connecting Tech Pros Worldwide Help | Site Map

Acces to TD in array on html document ?

Moi
Guest
 
Posts: n/a
#1: Jul 20 '05
Hi,

I have a 'small' problem for read and write something in TD cell

i try this:

d = window.document;

eTBL = d.getElementById('tbCal');
cTR = eTBL.getElementsByTagName('td');

cTD = new Array(); // Collection des TD ligne par ligne
for (i = 0; i < cTR.length; i++){
cTD[i] = cTR[i].getElementsByTagName('td');
alert("une cellule");
}

but if eTBL is correct...... cTR.length = 0

why this $%*#@ of value is 0???? my array have 8 lines with 7 cell for each,
but the first line have only 3 cell


HELP Please !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!



Nobody
Guest
 
Posts: n/a
#2: Jul 20 '05

re: Acces to TD in array on html document ?



"Moi" <moi@moi.com> wrote in message
news:bj7j1a$pn$1@news-reader1.wanadoo.fr...
| Hi,
|
| I have a 'small' problem for read and write something in TD cell
|
| i try this:
|
| d = window.document;
|
| eTBL = d.getElementById('tbCal');
| cTR = eTBL.getElementsByTagName('td');
|
| cTD = new Array(); // Collection des TD ligne par ligne
| for (i = 0; i < cTR.length; i++){
| cTD[i] = cTR[i].getElementsByTagName('td');
| alert("une cellule");
| }
|
| but if eTBL is correct...... cTR.length = 0
|
| why this $%*#@ of value is 0???? my array have 8 lines with 7 cell for
each,
| but the first line have only 3 cell

Where's the rest of the page?

|
|
| HELP Please !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|


Vjekoslav Begovic
Guest
 
Posts: n/a
#3: Jul 20 '05

re: Acces to TD in array on html document ?


"Moi" <moi@moi.com> wrote in message
news:bj7j1a$pn$1@news-reader1.wanadoo.fr...[color=blue]
> Hi,
>
> I have a 'small' problem for read and write something in TD cell
>
> i try this:
>
> d = window.document;
>
> eTBL = d.getElementById('tbCal');
> cTR = eTBL.getElementsByTagName('td');[/color]

Shouldn't be cTR = eTBL.getElementsByTagName('tr'); ?

^^^
[color=blue]
>
> cTD = new Array(); // Collection des TD ligne par ligne
> for (i = 0; i < cTR.length; i++){
> cTD[i] = cTR[i].getElementsByTagName('td');
> alert("une cellule");
> }
>
> but if eTBL is correct...... cTR.length = 0
>
> why this $%*#@ of value is 0???? my array have 8 lines with 7 cell for[/color]
each,[color=blue]
> but the first line have only 3 cell
>
>
> HELP Please !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
>
>
>[/color]


Closed Thread