You are here: irt.org | FAQ | JavaScript | Table | Q12 [ previous next ]
The following HTML will not work on all browsers:
<table border=1> <tr> <td> <script language="JavaScript"><!-- document.write("JavaScript Text which may or may not be output"); //--></script> </td> <td> <script language="JavaScript"><!-- document.write("JavaScript Text which may or may not be output"); //--></script> </td> </tr> </table>
Whereas the following code will work on all:
<script language="JavaScript"><!-- document.write("<table border=1>"); document.write("<tr>"); document.write("<td>"); document.write("JavaScript Text which may or may not be output"); document.write("<\/td>"); document.write("<td>"); document.write("JavaScript Text which may or may not be output"); document.write("<\/td>"); document.write("<\/tr>"); document.write("<\/table>"); //--></script>