Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help from a JS guru

Status
Not open for further replies.

kss444

Programmer
Sep 19, 2006
306
US
I need to create a table by just using the dom object, (not my choice but I have to work with what I have been given)
Example: createElement('table');
createElement('tr');
createElement('td') ect...
I need this to work for IE and FF.

What I want will have nested tables;
I want one table with 2 rows, the second row will have 3 cols. In each of the 3 cols will be one table with 2 cols each. To populate the rows of the 3 additional tables I will be looping through arrays (one array for each table).

Any examples or stub code would be great.
But my main question is for each table do I need to create a tbody tag as well?

I have done alot of research and people are saying that you need a tbody tag for your table, but do I need it for each table?

Thanks to all who reply,
KSS

Ordinary Programmer
 
tbody (along with thead and tfoot) help the browser know where to render rows and make CSS styling elements easier.

pretty sure every js library has a function for creating dom objects. these libraries abstract the browser for you so you don't need to worry about that. I prefer jquery. the online docs are great. everything you would need can be found there.

i think there may even be a template plug-in for jquery where you can define a template in html and populate it with json data.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top