471,851 Members | 860 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,851 software developers and data experts.

Outputting a Table in javascript

I am new to this forum and to javascript I have something due for class tomorrow but I can't figure out what is wrong with this code that it won't output a table to the screen. I don't understand how to embed the html inside of the document.write command. Any help is much appreciated.

[HTML]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang = "en" dir="ltr">
<link rel="stylesheet" href="js_styles.css" type="text/css" />
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title>Highest Waterfalls</title>
<script type="text/javascript">
/* <![CDATA[ */
This document prints the names, locations, and heights of the 10 highest waterfalls in the world.
document.write("<h1>Don's Jungle Tours</h1>");
/* ]]> */

<h1>Highest Waterfalls</h1>
<p>The names, locations, and heights of the 10 highest waterfalls in the world are as follows:</p>
<table> <COLGROUP span="3" width="20"/>
<script type="text/javascript">
/* <![CDATA[ */
document.write("<tr><th>Name</th><th>Location</th><th>Height (in meters)</th></tr>");
document.write("<tr><td>Angel (upper fall)</td><td>Venezuela</td><td>807</td></tr>";
document.write("<tr><td>Vestre Mardola</td><td>Norway</td><td>468</td></tr>");
document.write("<tr><td>Cleve-Garth</td><td>New Zealand</td><td>450</td></tr>");
/* ]]> */
Aug 26 '08 #1
1 1760
5,390 Expert Mod 4TB
check all your document.write() statements for correct syntax ... have a look at line 25 for example ... ;)

kind regards
Aug 26 '08 #2

Post your reply

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

Similar topics

12 posts views Thread by Craig Thomson | last post: by
15 posts views Thread by Jarrod Morrison | last post: by
3 posts views Thread by BakedBean | last post: by
2 posts views Thread by andy.z | last post: by
reply views Thread by NeoPa | last post: by
reply views Thread by YellowAndGreen | last post: by
reply views Thread by aboka | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.