Switch to full style
JavaScript code examples
Post a reply

Javascript Multi-dimensional Arrays

Sun Sep 18, 2011 12:22 am

Multi-dimensional array
Code:

<html>
<
title>Multi-dimensional array  javascript example</title>
<
head>
<
script language="JavaScript" type="text/JavaScript">
var sportStars = new Array (
 ["Red", "20 cars", "45 motorcycle"],
 ["Blue", "30 cars", "3 motorcycle"],
 ["Black", "4 cars", "3 motorcycle"],
 ["White", "3 cars", "2 motorcycle"]
)
</script>

</head>

<body>
 
<script language="JavaScript" type="text/JavaScript">

document.write("<table><tr><th width=\"150\">Color<th width=\"150\">Available Cars<th width=\"150\">Available motorcycle</tr>");
 
  for (a=0;a<=3;a++){
        document.write("<tr><td align='center'>" + sportStars[a][0] + "</td><td align='center'>" + sportStars[a][1] + "</td><td align='center'>" + sportStars[a][2] + "</td></tr>");
}
document.write("</table>");
</script>


</body>
</HTML>




Post a reply
  Related Posts  to : Javascript Multi-dimensional Arrays
 Java Two Dimensional Array     -  
 clarification of high dimensional databases using query     -  
 use one dimensional array to solve sales commissions     -  
 Use two dimensional array to build company sales program     -  
 Multi Thread Program     -  
 Multi colored table rows     -  
 Toggle the Multi Monitor Setting in Windows XP     -  
 multi-frameset and non-re-sizable html frame pages     -  
 $2500 per month working with Multi-million dollar companies     -  
 Arrays in java     -  

Topic Tags

JavaScript Arrays