B
bissatch
Hi,
I am trying to use JavaScript to write a table column on a web page.
The code is as follows:
<html>
<head>
<script>
function displaycount() {
document.write ("<td colspan="5">Hello</td>");
}
</script>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="315"
id="g8clock">
<tr>
<td width="15"></td><td width="75">DAYS</td><td
width="75">HRS</td><td width="75">MINS</td><td width="75">SECS</td>
</tr>
<tr>
<script type="text/javascript">displaycount();</script>
</tr>
</table>
</body>
</html>
As can be seen, there is a section on in the table that calls the
function displaycount(). All this does is write the HTML to display a
new column.
For some reason, this doesnt work although. Can anybody tell me why
this work write the table column. I know the code document.write code
works because when I remove the function from inside the table and
change the output to doument.write("<p>Hello</p>") it works. Any help?
Cheers
Burnsy
I am trying to use JavaScript to write a table column on a web page.
The code is as follows:
<html>
<head>
<script>
function displaycount() {
document.write ("<td colspan="5">Hello</td>");
}
</script>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="315"
id="g8clock">
<tr>
<td width="15"></td><td width="75">DAYS</td><td
width="75">HRS</td><td width="75">MINS</td><td width="75">SECS</td>
</tr>
<tr>
<script type="text/javascript">displaycount();</script>
</tr>
</table>
</body>
</html>
As can be seen, there is a section on in the table that calls the
function displaycount(). All this does is write the HTML to display a
new column.
For some reason, this doesnt work although. Can anybody tell me why
this work write the table column. I know the code document.write code
works because when I remove the function from inside the table and
change the output to doument.write("<p>Hello</p>") it works. Any help?
Cheers
Burnsy