Bootstrap 3 responsive columns of varying heights

前端 未结 4 2061
余生分开走
余生分开走 2021-01-14 05:40

EDIT The pricing tables\' content will all be dynamically generated, I cannot predict their height, I\'m simply using the 400px case for th

4条回答
  •  醉话见心
    2021-01-14 06:14

    I know exactly what you're talking about as I have ran into the same issue. I don't know ruby, but the answer is simple:

    1. Use a for loop with a counter i
    2. When i % 4 == 0, print: <%=
    %> after your
    .
  • This way, every 4 entries, the class='row' will stop and create a new one. and the last row will not affect the next row and the class='col' will not be affected. This also works when screen size is lowered.

提交回复
热议问题