I need to arrange 5 divs (tiles) on each row in a consistent manner.
I attempted to accomplish this by checking for every 5th element and adding an empty div if the count is divisible by 5. However, this approach causes rows to start and end at different positions depending on word length. I want all start and end positions to be aligned, similar to a table layout.
For a demonstration, I have created a code sandbox:
https://codesandbox.io/s/grids-5-on-a-line-wghvs?file=/src/App.tsx
Here is an image showing my current output: https://i.sstatic.net/coLJ1.png
Can CSS styling achieve this alignment, or should I consider using a table instead? Any suggestions for a solution would be greatly appreciated.