JavaScript Forum JS Made Easy: Free JavaScripts Tutorials Example Code
About This Product
FontsMadeEasy.com
 
The Business Internet
Find it on This page:
 
| Over 5000 Free Fonts | Tutorials | Javascript Forum | Other Javascript Resources | Cheat Sheet

     
Jsmadeeasy Forums Home   Search   Login   Register   Member List  
JS Made Easy  > JavaScript programming  > Re:  
 
Display using:  
Previous Thread :: Next Thread 
 Author Thread: document.write a table
kankula is not online. Last active: 7/28/2004 3:52:08 PM kankula
Top 50 Poster
Joined: 28 Jul 2004
Total Posts: 3
 
document.write a table
Posted: 20 May 2002 01:59 PM
hey folks...hope someone can help. I am trying to write a script that will open a new window (easy) and then document.write a table that has variables plugged into the cells. I have already gotten through the opening a window and document.write(ing) text and variables, but I need the table to make everything line up. Hope this makes sense. I think there is something to do with the quote marks or parens that causes the script to produce errors. Any help is appreciated. -Jim

If it were easy, there wouldn't be a forum for it.

If it were easy, there wouldn't be a forum for it.
qsaaiman is not online. Last active: 5/30/2006 4:23:08 AM qsaaiman
Top 25 Poster
Joined: 28 Jul 2004
Total Posts: 21
 
Re:
Posted: 21 May 2002 01:19 AM
Hey.

I am not exactly sure what it is you are asking. Though i have this little piece of code that might be what you are looking for:

<script language="JavaScript">
function write_table() {
var tempy1 = "Test 1"
var tempy2 = "Test 2"
// use single quotes or no quotes for the tag attributes
document.write("<table width='100%'><tr>")
document.write("<td>")
document.write("This is : " + tempy1 + " data")
document.write("</td>")
document.write("</tr><tr>")
document.write("<td>")
document.write("This is : " + tempy2 + " data")
document.write("</td>")
document.write("</tr></table>")
}
</script>


Hope that helps.

Regards

Quintin Saaiman
Department of Labour
IT Systems

Edited by - qsaaiman on 05/21/2002 01:23:51

Quintin Saaiman
kankula is not online. Last active: 7/28/2004 3:52:08 PM kankula
Top 50 Poster
Joined: 28 Jul 2004
Total Posts: 3
 
Re:
Posted: 21 May 2002 11:37 AM
Yes that did the trick......using single quotes within tags is the key. THANKS

If it were easy, there wouldn't be a forum for it.

If it were easy, there wouldn't be a forum for it.
Previous Thread :: Next Thread 
Goto to page:  Prev Next
 
Jsmadeeasy.com  > JS Made Easy  > JavaScript programming  > Re: