JSFiddle - React, Tailwind, and code Playground
HTML
<div id="inventory-dialog" class="dialog">
<div id="inventory-grid"></div>
</div>
CSS
#inventory-grid {
position: relative;
top: 150px;
margin: 0 auto;
width: 400px;
height: 400px;
border: 1px solid black;
}
.inventory-cell {
width: 50px;
height: 50px;
border: 1px solid black;
float: left;
}
CoffeeScript
for i in [1, 2, 3, 4, 5, 6, 7, 8]
console.log "cell #{i} was created!"
cell = $('<div class="inventory-cell"></div>').mousedown (event) ->
alert "#{i} was clicked!"
$("#inventory-grid").append(cell)