Styling for the container :
grid-template-rows: repeat(5,auto);
grid-template-columns: repeat(20,auto);
Next step is to generate 100 elements (cells) as child components.
Adjustment
The comprehensive solution :
HTML CODE:
<div class="parent"></div>
CSS CODE:
.parent {
display: grid;
grid-template-rows: repeat(20, auto);
grid-template-columns: repeat(5, auto);
gap: 10px;
}
.child {
width: 100px;
height: 100px;
background-color: black;
}
JS CODE:
For generating 100 elements
let container = document.querySelector("div");
for (let i = 1; i <= 100; i++) {
let childElement = document.createElement("div");
childElement.className = "child";
container.append(childElement);
}
Important: This amendment creates 5 rows and 20 columns for better alignment.