Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #22662

Re: Duplicating the last row of a Table

From Zlatko Duric <zladuric@gmail.com>
Newsgroups comp.lang.javascript
Subject Re: Duplicating the last row of a Table
Date 2014-01-18 01:52 +0100
Message-ID <bju1j4Fjf5sU1@mid.individual.net> (permalink)
References <ZemAs3VzQa2SFwhs@invalid.uk.co.demon.merlyn.invalid>

Show all headers | View raw


That's a good behavior, because with the first quoted statement you're 
not getting a tbody element. You're getting its rows, and an array has 
no method appendChild (by default).

On 01/17/2014 10:44 PM, Dr J R Stockton wrote:

 > var Rose = document.getElementById("TB").rows

[cut]

 > Rose.appendChild(newnode);

[cut]

 > Cel = Rose.item(Y).cells.item(X)


So, you can do something like this to get the tbody:

     var tb = document.getElementById('tb');

and then use that in further code and append a row to tb.

You get rows with something like document.getElementById('table-id').rows.

-- 
Zlatko

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Duplicating the last row of a Table Dr J R Stockton <reply1400@merlyn.demon.co.uk.invalid> - 2014-01-17 21:44 +0000
  Re: Duplicating the last row of a Table Zlatko Duric <zladuric@gmail.com> - 2014-01-18 01:52 +0100
    Re: Duplicating the last row of a Table Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-01-18 12:53 +0100
      Re: Duplicating the last row of a Table RobG <rgqld@iinet.net.au> - 2014-01-19 17:00 +1000
        Re: Duplicating the last row of a Table Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-01-19 14:41 +0100
  Re: Duplicating the last row of a Table "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-01-18 12:16 +0100
    Re: Duplicating the last row of a Table Dr J R Stockton <reply1400@merlyn.demon.co.uk.invalid> - 2014-01-19 17:00 +0000
  Re: Duplicating the last row of a Table Danny <dann90038@gmail.com> - 2014-01-18 11:32 -0800

csiph-web