www.webdeveloper.com
Results 1 to 1 of 1

Thread: [RESOLVED] Multidimensional Arrays Help

  1. #1
    Join Date
    Mar 2013
    Posts
    61

    resolved [RESOLVED] Multidimensional Arrays Help

    I'm trying to build a table using Javascript. To save some hassle I want to create and populate the table using some functions I've made. For some reason when I run y for loop I get it undefined. This is probably me just derping over a very easy concept, but I would appreciate the help.


    Code:
    function sampleInfo()
    {
    	var peopleInfo = [["You", location[0], 0798306705],["Mark", location[1], 12309], ["Jance", location[2], 1231568]] ;
    	tableCreation( peopleInfo )	
    }
    
    
    function tableCreation( info )
    {
    	var table = document.getElementById("tableHolder");
    	
    	for( var i = 0; i < 3; i++)
    	{
    		var row = table.insertRow();
    		for(var q = 0; q < 3; q++)
    		{
    			row.insertCell(q).innerHTML = info[i[q]];
    		}
    	}
    	
    }
    Solved.

    info[i][q];
    Last edited by KarneeKarnay; 09-23-2013 at 09:03 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles