469,361 Members | 2,429 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Generate Table and attributes at runtime

101 100+
Hi,

I have to generate a DOM table Run time but how can i generate it's attribute like name and id etc.


Please Help,

Regards,
Oct 31 '07 #1
2 2020
acoder
16,027 Expert Mod 8TB
What do you mean by generate? Do you want to give it a unique name and id?

You could keep a global variable or use the table row number.
Oct 31 '07 #2
dmjpro
2,476 2GB
Hi,

I have to generate a DOM table Run time but how can i generate it's attribute like name and id etc.


Please Help,

Regards,

Expand|Select|Wrap|Line Numbers
  1. var tab_ref = document.createElement('TABLE');
  2. tab_ref.setAttribute('name','some_name');
  3. ...
  4. ...
  5. parent_ref.appendChild(tab_ref); //add the element to parent node
  6.  
Debasis
Oct 31 '07 #3

Post your reply

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

Similar topics

1 post views Thread by A Traveler | last post: by
5 posts views Thread by Steven Berkovitz | last post: by
10 posts views Thread by Karl-Inge Reknes | last post: by
2 posts views Thread by prabhupr | last post: by
5 posts views Thread by florin | last post: by
reply views Thread by zhoujie | 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.