Шрифт
Фон
var minesCount = 10;
var mines = fillMines(rowCount, colCount, minesCount);
var tbl = document.getElementById(«tbl»);
for (var i = 0; i < rowCount; i++)
{
var row = tbl.insertRow(i);
for(var j = 0; j < colCount; j++)
{
var cell = row.insertCell(j);
if (mines[i * rowCount + j] == 1)
cell.innerHTML = '*'
else
cell.innerHTML = '.';
}
}
}
script>
<body onload=«initTable();">
<table id=«tbl» border=«2» width=«80%" height=«80%">
table>
body>
html>
Шрифт
Фон