DEV Community

Discussion on: Inside a dev's mind: How do you plan a UI feature?

Collapse
 
kelvin9877 profile image
Kelvin Liang

I tend to use 3D array to store posts data, and render them in HTML Table format. (it make more sense to me rather than use flex or grid).

 const result = new Array(7).fill().map(() => new Array(24).fill().map(() => new Array()));

It is easier to retrieve the posts by data[row][col], get the number of posts by data[row][col].length, in 2D coordinate system (I am not sure how to do the color yet).