To solve the problem of evenly dividing the width when implementing a calendar component, ask for help.

above:

clipboard.png

now there is a need like this: when there is a conflict in the schedule, the schedule of the conflict should be evenly divided into the width, and the full width should be occupied when there is no conflict.
now my implementation is to use flex:1, directly to split the width of everything, but as the figure shows, 20:00-23:00 should take up the full width.
how to ask for help from the Great God?

Mar.28,2021

each white box is set to a separate flex layout. Try


dude, how did you draw this calendar at last? ask how to calculate the width

.
Menu