What would be the optimum strategy to display elements in the js
file on the following html
page in the div
?
html file:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>SO example</title>
</head>
<body>
<div id="text_table"></div>
</body>
</html>
css file
#text_table {
top: 10px;
right: 10px;
left: 10px;
}
js file
var testResults = [
['Nickname', 'Points', 'Time', 'Difficulty'],
['Nickname', 'Points', 'Time', 'Difficulty'],
['Nickname', 'Points', 'Time', 'Difficulty'],
['Nickname', 'Points', 'Time', 'Difficulty'],
['Nickname', 'Points', 'Time', 'Difficulty'],
];
var textTable = document.getElementById("text_table");
for (var i = 0; i < testResults.length; i++) {
/* leaders.innerHTML += */
};