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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

document.write 1

Status
Not open for further replies.

greyone

Programmer
Dec 14, 2000
200
CA
i'm running a for loop to write table rows in the table as follows. The problem is when i run the code it makes table within a table. I just want to write one table and run the loop to add table rows

estr='<table border=0 cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;>'
estr+='<tr><td align=&quot;left&quot;>'
for (i=0;i<menu1.length;i++)
document.write(estr+menu1+'</td></tr></table>')
 
Try doing something like the following

estr='<tr><td align=&quot;left&quot;>'
document.write (<table border=0 cellpadding=0 cellspacing=0>
for (i=0;i<menu1.length;i++)
document.write(estr+menu1+'</td></tr>')
document.write(</Table>)

Do the opening and closing table commands outside of the for loop.

Walter III

Walt III
SAElukewl@netscape.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top