I need a grid with 100 cells for a battleship game I'm making (using html, css, and JavaScript), but I don't want to create 100 divs in html to make it.
<div class="container">
<div class="item-1"></div>
<div class="item-2"></div>
<div class="item-3"></div>
<div class="item-4"></div>
<div class="item-5"></div>
<div class="item-6"></div>
...
</div>
Is there way were I can avoid this and then just access them by parent in css?
.cell:nth-child(n) {
//code
}
I know a way where I can work around this without using a grid, but this seems the most simple way if I can just get past this. Any help would be appreciated.