Replies: 1 comment
-
Hey @maxpaleo! Here's the solution: grid grid-cols-[repeat(auto-fit,minmax(calc((100%-16px*3)/4),1fr))] gap-4 In this code, You can view a complete example here: Tailwind Play Example. Please let me know if you have any questions. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi guys,
This is probably a a ridiculous question; but for the life of me; I can't figure it out!
I have been struggling with creating a simple grid layout with Tailwind, where the maximum number of columns in a row should be 4 if there are 4 columns, but there should be 3 columns if there are only 3.
I am from Bootstrap, which is pretty straightforward, but I can't seem to get it right with TW.
Note: I am trying to avoid using JS for this as well.
Summary:
-If there are 3 columns, the columns should expand to fill the width of the row.
-if there is just 1 column, it takes the full width.
Beta Was this translation helpful? Give feedback.
All reactions