shoopik,
 
<!DOCTYPE html>
<html>
<head>
  <title>Untitled</title>
  <meta charset="utf-8">
  <style type="text/css">
  div.block {
    height: 50px;
    width: 50px;
    background-color: #FFFF00;
    margin: 2px;
  }
 #game{
   display: flex;
   background-color: #0000FF;
   width: 162px;
 }
  </style>
</head>
<body>
<div id="game"></div>
 <script>
function pole(rows, cols, el) {
  el = document.getElementById(el)
  for (; rows--;) {
    var div = document.createElement("div");
    for (var j=0; j<cols; j++) {
      var d = div.cloneNode();
      d.classList.add("block");
      div.appendChild(d);
    };
    el.appendChild(div)
  };
};
 pole(3, 3, "game")
  </script>
</body>
</html>