[Javascript] array question

Andrew Gibson andyg at ihug.co.nz
Tue Mar 25 23:18:49 CST 2003


I think you'd have a couple of options

1. Write a string which includes the <table<tr> tags and so build your table
2. Look into dhtml so you can create table rows, cells on the fly and put
your content in the cells via .innerText

http://www.w3schools.com/dhtml/dhtml_dom_table.asp

has a great tutorial on this.

Andrew Gibson

===================================================
Subject: [Javascript] array question

My situation is similar to the person who wants to display 1000 array items.

I have some weather data held in arrays (max temp, min temp, rainfall
average for the month, average pressure) etc - all in single arrays
containing the 12 items.

I want to be able to display them in table format with the following:

Column 1, row 1 - Average Max Temp
Column 2, row 1 - Average Min Temp
Etc

In row 2, I want to display the array data relevant to the value.

The material (row 2 data) is updated each new month. The following is the
javascript I have so far for the above that works without tables. How can I
get it to work within a table so the formatting is better? Thanks.





More information about the Javascript mailing list