Тэг script тоже работает
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<script>
var n = 2, m = 9;
var colorRandom = function randomInteger(min, max) {
var rand = min + Math.random() * (max + 1 - min);
rand = Math.floor(rand);
return rand;
}
var mas = [];
for (var i = 0; i < m; i++){
mas[i] = [];
for (var j = 0; j < n; j++){
mas[i][j] = colorRandom(0, 255);
}}
var table = document.createElement('table'),
tr = table.appendChild(document.createElement('tbody'))
.appendChild(document.createElement('tr'));
for (i = 1; i < 9; i++) {
tr.appendChild(document.createElement('td'));
};
document.body.appendChild(table);
</script>
</body>
</html>
|