• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to add multiple rows dynamically to a table using javascript

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
1)i have a table "maintable"
2)inside "maintable" i have 3 rows calles "row1" "row2" "row3".
3)in "row1" i have [+] and[-] button to add and delete respectively, when i click [+] "row1" "row2" "row3" should add at once, and same for [-] to delete.
4) and also i have "Address Seq Num " in "row1" the value of this should be 1,2,3..like serial number for the sucessive additon of rows.

5)and in "row3" i have table called "innertable" ,inside this it has body called "innerbody" inside this it has a row called "innerrow" this "innerrow also had [+][-] buttons.
6)this "innerrow" should be added when [+] is clicked and shluld be deleted when [-] button clicked.
please help me..i'm strucked in this...

 
Rancher
Posts: 1044
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can manipulate the DOM objects from javascript, even create new ones.
(You can google it with key words from the previous sentence.)

An example (albeit not table):

for example
 
Ivan Jozsef Balazs
Rancher
Posts: 1044
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A code snippet dynamically creating a row of a table.

 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic