Output array element in a HTML table format
|
|
<html> <head> <title>Table of Phone Numbers</title>
</head> <body>
<h1>Table of Phone Numbers</h1>
<table border="1">
<script language="javascript" type="text/javascript"> <!--
var myArray = new Array(); myArray[0] = "1"; myArray[1] = "2"; myArray[2] = "3"; myArray[3] = "4"; myArray[4] = "5";
for (var i=0; i<5; i++) { document.write("<tr><td>Number " + i + " is:</td>"); document.write("<td>" + myArray[i] + "</td></tr>"); }
//--> </script>
</table>
</body> </html>
|
|
|
HTML code for linking to this page:
Related in same category :
-
-
-
-
-
-
|