-
DOM Table in Mozilla
I have created a 4x3 table in HTML and I am populating it from a Javascript
which basically loops through values. This works fine in IE 5/6 but in Mozilla
1.2/1.3 and Netscape the table is created but is not populated. Any help
would be appreciated, my code is as follows :
<!-- index.htm -->
<html>
<head>
<script language="Javascript" src="index.js"></script>
<title>DOM</title>
</head>
<body id="bodyNode">
<table id="tableNode" border="1">
<tbody id="tbodyNode">
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</tbody>
</table>
<script>PopulateTable()</script>
</body></html>
<!-- index.js -->
function PopulateTable()
{
var row, col, cell;
cell = 1;
for (row = 0; row <= 2; row ++)
{
for (col = 0; col <= 3; col ++)
{
tbodyNode.childNodes[row].childNodes[col].firstChild.data = "Value
:" + cell;
cell ++;
}
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks