How To Display Array Element in HTML format using java script ?

Ranjeet_8
Posted by Ranjeet_8 under JavaScript category on | Points: 40 | Views : 1373
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<h1>Display In Table</h1>
<table style="border:1px solid;" border="1px">
<script language="javascript" type="text/javascript">
var RecArray = new Array();
RecArray[0] = "001";
RecArray[1] = "002";
RecArray[2] = "003";
RecArray[3] = "004";
RecArray[4] = "005";
RecArray[5] = "006";
RecArray[6] = "007";

for (var i = 0; i < 7; i++) {
document.write("<tr><td>Emp_Code :</td>");
document.write("<td>" + RecArray[i] + "</td></tr>");
}
</script>

</table>

</body>
</html>

Comments or Responses

Login to post response