Multiplication table
Basic question where you take a value and create a multiplication table.
HTML
<!DOCTYPE html>
<html>
<head>
<title>Multiplication Table</title>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var board = 0,boards = [];
$('#generate-btn').click( function (){
$('#multiplication-table').html('');
board = $('#board').val();
temp_src=""
for (var row=1; row<=board; row++) {
temp_src =
$('<tr></tr>');
for (var cols=1; cols<= board; cols++) {
temp_src.append($('<td>'+ row*cols +'</td>'));
}
$('#multiplication-table').append(temp_src);
}
});
});
</script>
</head>
<body>
<h1>Create a multiplication table with index labels for mapping</h1>
<h3>The size of the multiplication table varies from the input (take note) its not fixed.</h3>
<h2>Multiplication table</h2>
<input type="number" id="board"><br>
<button type="button" id="generate-btn">Generate</button>
<table border="2"id="multiplication-table">
</table>
</body>
</html>