469,270 Members | 1,093 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,270 developers. It's quick & easy.

How to insert a row dynamically in a table which already exists in the page?

129 100+
Hello friends,
What my doubt is, a page is already designed in that page a table exists, and i am doing a script like a radio button exixts and when click that radio button some function is called and in that function i want to create a extra row in that table which already exists on page. That is my problem.

How to insert a row dynamically in a table which already exists in the page?
Nov 11 '08 #1
7 5200
acoder
16,027 Expert Mod 8TB
You can use the insertRow() method.

PS. please use a good thread title. I've changed it to better describe the problem.
Nov 11 '08 #2
sasimca007
129 100+
Thank you my friend i change how to put better title for questions.
But can you help me with some sample code.

Ok i got the sample code but it inserts a row on top of the table, but i want to add a row in middle of table i.e after some fields.
Nov 11 '08 #3
acoder
16,027 Expert Mod 8TB
Use the index to add the row at the specified position, e.g. insertRow(2) would add above the third row.
Nov 11 '08 #4
sasimca007
129 100+
Hai friend,
Thanks for helping me but one another doubt if i want to modify a column of a row already existed in the table, how to do this? Is there any function like selectRow etc.....
Nov 12 '08 #5
acoder
16,027 Expert Mod 8TB
Once you have the row, use the the cells[] array to get the cells within a row and use the index to get the column you're after. To modify it, you can simply use its innerHTML property.
Nov 12 '08 #6
sasimca007
129 100+
Thank you my friend its working. Thank you.
Nov 12 '08 #7
acoder
16,027 Expert Mod 8TB
You're welcome. Glad to help :)
Nov 12 '08 #8

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

11 posts views Thread by Jean-Christian Imbeault | last post: by
16 posts views Thread by Philip Boonzaaier | last post: by
2 posts views Thread by Alex | last post: by
7 posts views Thread by Kevin Lawrence | last post: by
6 posts views Thread by rn5a | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.