Skip to content

Instantly share code, notes, and snippets.

@brun0xff
Created April 24, 2017 01:52
Show Gist options
  • Save brun0xff/c168143de3faa71253c573abde76e207 to your computer and use it in GitHub Desktop.
Save brun0xff/c168143de3faa71253c573abde76e207 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<!-- Q04-P1 -->
<html>
<head>
<meta charset="utf-8">
<title>Tabela de Multiplicação</title>
<style type="text/css">
#titulo {
text-align: center;
background-color: gray;
}
tr {
text-align: center;
}
</style>
</head>
<body>
<table border="1">
<caption></caption>
<thead>
<tr>
<td id="titulo" colspan="2">Produto de 7</td>
</tr>
</thead>
<script type="text/javascript">
for(var i = 1; i <= 10; i++) {
var x = (Math.floor(((Math.random() * 10) +1)));
document.writeln("<tr>");
document.writeln("<td> "+i+" x "+x+"</td>");
document.writeln("<td>"+i*x+"</td>");
document.writeln("</tr>");
}
</script>
</table>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment