I'm, trying to create a 2-D grid of 1000 nodes divided into 20 rows and each row has 50 cols.
see the grid here
I'm trying to close the small gap between the 2 rows but can't. Can anyone help?
grid.jsx
const Grid = ({ grid }) => {
return (
<div className="row">
{grid.map((row, rowIdx) => {
return (
<div key={rowIdx}>
{row.map((node) => (
<Node node={node} />
))}
</div>
);
})}
</div>
);
};
Node
const Node = ({ node }) => {
return <div onClick={() => getNode(node)} className="node"></div>;
};
function getNode(node) {
console.log("row=", node.row, "col=", node.col);
}
the css file
.App {
text-align: center;
}
.button {
margin-top: 10px;
margin-left: 10px;
justify-content: center;
}
.node {
width: 20px;
height: 20px;
border: 1px solid rgb(175, 216, 248);
display: inline-block;
}
.row {
/* display: grid; */
justify-content: center;
margin-top: 100px;
}