P
P E Schoen
I have a table which is filled with name, title, email, and phone numbers.
To make it easier to maintain I create a script which adds the rows and
items from an array. It works fine but according to the HTML 4.01
transitional validator the script is not allowed there.
<div align="center"><h1 style="font-size:
12pt;">Contacts</h1></div>
<table cellpadding="2" cellspacing="2" border="2"
style="text-align: left; width: 342px; ">
<tbody>
<tr>
<td width="231" style="vertical-align: top;"><b>Name</b>
</td>
<td width="89" style="vertical-align: top;"><b>Phone
Number</b><br>
</td>
</tr>
<script language="JavaScript" src="contacts.js"
type="text/javascript"> </script>
</tbody>
</table>
The script is:
var contact = new Array();
contact[0] = ["Name0", "Title0", "mailto:[email protected]",
"000-555-5555"];
...
contact[17]
for (i=0; i<=17; i++) {
document.write( "<tr><td ><p><b>" + contact[0] + "</b><Br>\n");
document.write( contact[1] + "<br>\n");
document.write( "<a href='" + contact[2] + "'>Email</a></td>\n");
document.write( "<td style='vertical-align: top;'><br>\n");
document.write( contact[3] + "<br> </td> </tr>\n");
}
I can probably construct the entire table with the script. I did not see any
information about script not allowed within a table. I referred to
http://www.w3.org/TR/html4/interact/scripts.html
Thanks,
Paul
To make it easier to maintain I create a script which adds the rows and
items from an array. It works fine but according to the HTML 4.01
transitional validator the script is not allowed there.
<div align="center"><h1 style="font-size:
12pt;">Contacts</h1></div>
<table cellpadding="2" cellspacing="2" border="2"
style="text-align: left; width: 342px; ">
<tbody>
<tr>
<td width="231" style="vertical-align: top;"><b>Name</b>
</td>
<td width="89" style="vertical-align: top;"><b>Phone
Number</b><br>
</td>
</tr>
<script language="JavaScript" src="contacts.js"
type="text/javascript"> </script>
</tbody>
</table>
The script is:
var contact = new Array();
contact[0] = ["Name0", "Title0", "mailto:[email protected]",
"000-555-5555"];
...
contact[17]
for (i=0; i<=17; i++) {
document.write( "<tr><td ><p><b>" + contact[0] + "</b><Br>\n");
document.write( contact[1] + "<br>\n");
document.write( "<a href='" + contact[2] + "'>Email</a></td>\n");
document.write( "<td style='vertical-align: top;'><br>\n");
document.write( contact[3] + "<br> </td> </tr>\n");
}
I can probably construct the entire table with the script. I did not see any
information about script not allowed within a table. I referred to
http://www.w3.org/TR/html4/interact/scripts.html
Thanks,
Paul