I'm trying to make a practice website involving a table of data, in this case albums. Eventually I want to be able to organize the information in alphabetical or numerical order, but for now all I want to do is use JavaScript to take arrays and to create a table with those values. I know I can use XML or JQuery for this, but for now I want to focus on JavaScript. Here's the code:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Highlight Table Example</title>
	<script>
function Album(artist,title,year,genre) {
	this.artist=artist;
	this.title=title;
	this.year=year;
	this.genre=genre;

	this.toHTML = function() {
		var tableGoodness = "";
		var x=album;
		
		tableGoodness += ("<table border='1'><tr bgcolor='#9acd32'><th>Artist</th><th>Title</th><th>Year</th><th>Genre</th></tr>"
			+ function() { 
				for (i=0;i<x.length;i++) {					"<tr><td>" + artist + "</td><td>" + title + "</td><td>" + year + "</td><td>" + "</td></tr>"; }				+ "</table>";			}		});
		return tableGoodness;
		document.getElementById("goodTable").innerHTML = tableGoodness;
	}
document.getElementById("goodTable").innerHTML = tableGoodness;
	

var album = [ 	new Album("The Beatles","Sgt. Pepper's Lonely Hearts Club Band","1967","Rock"),
				new Album("Mastodon","Leviathan","2004","Metal"), 
				new Album("Minus the Bear","Highly Refined Pirates","2001","Alternative"), 
				new Album("Dead Kennedys","Plastic Surgery Disasters", "1982","Punk"), 
				new Album("Snoop Dogg","Doggystyle","1993","Hip hop"), 
				new Album("Nirvana","Nevermind","1991","Alternative"), 
				new Album("The Mermen","A Glorious Lethal Euphoria","1994","Rock"), 
				new Album("Daft Punk","Random Access Memories","2013","Pop"), 
				new Album("Pelican","Australasia","2003","Metal"), 
				new Album("Gotye","Making Mirrors","2012","Pop"), 
				new Album("Metallica","Master of Puppets","1986","Metal"), 
				new Album("Radiohead","Kid A","2000","Alternative"), 
				new Album("Hum","You'd Prefer an Astronaut","1994","Alternative"), 
				new Album("Pretty Lights","A Color Map of the Sun","2013","Electronic")
				new Album("Massive Attack","Mezzanine","1996","Electronic")
				new Album("Brother Ali","The Undisputed Truth","2007","Hip hop")
				new Album("Miles Davis","*****es Brew","1971","Jazz")
				new Album("Bad Religion","Suffer","1988","Punk")];
];
				
				

</script>
</head>
<body>
<div id="goodTable">



</div>
</body>
</html>
Opinions of my musical tastes aside, how can I fix this? I figure one of two ways, either insert the Array by row or assign a value to each column. I think I'm almost there..........