Acces to TD in array on html document ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Moi

    #1

    Acces to TD in array on html document ?

    Hi,

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

    i try this:

    d = window.document ;

    eTBL = d.getElementByI d('tbCal');
    cTR = eTBL.getElement sByTagName('td' );

    cTD = new Array(); // Collection des TD ligne par ligne
    for (i = 0; i < cTR.length; i++){
    cTD[i] = cTR[i].getElementsByT agName('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

    #2
    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.getElementByI d('tbCal');
    | cTR = eTBL.getElement sByTagName('td' );
    |
    | cTD = new Array(); // Collection des TD ligne par ligne
    | for (i = 0; i < cTR.length; i++){
    | cTD[i] = cTR[i].getElementsByT agName('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 !!!!!!!!!!!!!!! !!!!!!!!!!!!!!! !!!!!!!!!!!!!!
    |
    |
    |


    Comment

    • Vjekoslav Begovic

      #3
      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.getElementByI d('tbCal');
      > cTR = eTBL.getElement sByTagName('td' );[/color]

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

      ^^^
      [color=blue]
      >
      > cTD = new Array(); // Collection des TD ligne par ligne
      > for (i = 0; i < cTR.length; i++){
      > cTD[i] = cTR[i].getElementsByT agName('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]


      Comment

      Working...