Little Grid
const NUM = 9
const col = 3
const size = 30
const pad = 10
const box = (x, y) => Object.assign(
document.body.appendChild(
document.createElement('div')
).style, {
position: 'absolute',
width: size + 'px',
height: size + 'px',
top: y + 'px',
left: x + 'px',
background: 'red'
})
const off = (size + pad)
for (let i = 0; i < NUM; i++) {
const x = (i % col) * off
const y = parseInt(i / col, 10) * off
box(x, y)
}