473,837 Members | 1,553 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Outputting a Table in javascript

2 New Member
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>Highes t 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"/>
<tr><th>Name</th><th>Location </th><th>Height</th></tr>
<script type="text/javascript">
/* <![CDATA[ */
document.write( "<tr><th>Na me</th><th>Location </th><th>Height (in meters)</th></tr>");
document.write( "<tr><td>An gel (upper fall)</td><td>Venezuel a</td><td>807</td></tr>";
document.write( "<tr><td>Itatin ga</td><td>Brazil</td><td>628</td></tr>");
document.write( "<tr><td>Cuquen an</td><td>Guyana/Venezuela</td><td>610</td></tr>");
document.write( "<tr><td>Ormeli </td><td>Norway</td><td>563</td></tr>");
document.write( "<tr><td>Ty sse</td><td>Norway</td><td>533</td></tr>");
document.write( "<tr><td>Pi lao</td><td>Brazil</td><td>524</td></tr>");
document.write( "<tr><td>Ribbon </td><td>USA</td><td>491</td></tr>");
document.write( "<tr><td>Ve stre Mardola</td><td>Norway</td><td>468</td></tr>");
document.write( "<tr><td>Kaiete ur</td><td>Guyana</td><td>457</td></tr>");
document.write( "<tr><td>Cl eve-Garth</td><td>New Zealand</td><td>450</td></tr>");
document.write( "</table>");
/* ]]> */
Aug 26 '08 #1
1 1887
5,390 Recognized Expert Moderator Expert
check all your document.write( ) statements for correct syntax ... have a look at line 25 for example ... ;)

kind regards
Aug 26 '08 #2

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

Similar topics

by: Craig Thomson | last post by:
Do people generally try and output nicely formatted html from their scripts? I have been trying to, with variable indenting for tables etc. It makes it easier to see the html and perhaps debug it, but it can make ugly looking scripts. What's the general consensus? Craig
by: Jarrod Morrison | last post by:
Hi All Im generally a vb programmer and am used to referencing multiple records returned from a query performed on an sql database and im trying to move some functions of my software into sql stored procedures. So far ive been able to move the functions relatively easily but im unsure about how to output multiple values from an sql stored procedure. By this i mean for example one of the stored procedures may take your username and return...
by: BakedBean | last post by:
Hi, This is probably really simple, but I've only just been asked to look at this and I've spent a full day trying to get it to work, so any help will be very gratefully received! At present I have an HTML page which calls a series of javascript functions which output text into a browser. A client then asked if it was possible to output mathematical equations instead of just plain text! The solution I originally came up with was the...
by: ste | last post by:
Hi there, I'm trying to query a MySQL database (containing image data) and to output the results in a HTML table of 3 columns wide (and however many rows it takes) in order to create a basic thumbnail gallery. I can query and output the data as a single column table, but I'm having problems filling up a 3 column table (with different images, looping continuously until the end).
by: andy.z | last post by:
I'm confused - The following outputs a URL encoded string into an alert box ----------------------CUT ---------------------- function createEmbarrasment() { $tmp = urlencode("Your fly is undone!"); ?<script type="text/javascript"><!-- alert('<?php echo $tmp; ?>') //--</script> <?php
by: Peter Nimmo | last post by:
Hi, I am writting a windows application that I want to be able to act as if it where a Console application in certain circumstances, such as error logging. Whilst I have nearly got it, it doesn't seem to write to the screen in the way I would expect. The output is:
by: Markus | last post by:
Little problem here. How would i go about outputting "&raquo;" through giving something a value. i.e. if(validateEmail(emailValue) === false){ emailStyle.color = "red"; emailText.value = "&raqou; Invalid Email!"; } else {
by: mikeandike | last post by:
Alright, I feel like this is easy, but I haven't been able to figure it out: I have two database tables which I need to gather information from and output on a coldfusion page in a table. I know I can output the data I need in a row with: <cfquery name="list" datasource="abc"> select pkey, summary, stringvalue, numbervalue from abc.issue.id=abc.customfieldvalue.issue and project = 10200; </cfquery> <table>
by: Tarantulus | last post by:
Hi Guys, working on a solaris 9 box and I have an a problem I am not educated enough to solve :P bit of a boring one, essentially I have a monthly HTML report and I want to extract the tables from it into separate files each month. for example <table>
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.