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

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!news-1.dfn.de!news.dfn.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Zlatko Duric <zladuric@gmail.com>
Newsgroups comp.lang.javascript
Subject Re: Duplicating the last row of a Table
Date Sat, 18 Jan 2014 01:52:53 +0100
Lines 27
Message-ID <bju1j4Fjf5sU1@mid.individual.net> (permalink)
References <ZemAs3VzQa2SFwhs@invalid.uk.co.demon.merlyn.invalid>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Trace individual.net wZUjeSYEUD/YNInp/143IglxlykaXMrvz/VnRruGdVpUsdeJwP
Cancel-Lock sha1:WM/ISEae/PiinFQRX2W5t3Nv4t8=
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0
In-Reply-To <ZemAs3VzQa2SFwhs@invalid.uk.co.demon.merlyn.invalid>
Xref csiph.com comp.lang.javascript:22662

Show key headers only | 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