Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Close HTML tags within loop on an uneven number?

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #44118
    jacorre
    Participant

    Hi everyone,

    I was wondering if someone could help me find a solution to this problem? I am using a loop to output blog posts. These posts are being set up in a two column layout. So I start a row when the count is 1, I list two posts, and then I close the row when the count is two.

    The problem I ran into was if the row only had 1 post in it. It doesn’t close the row properly. I’m trying to figure out how to close the row if there’s only 1 post without causing a problem when there’s two posts?

    Thanks!

    #131793
    Kitty Giraudel
    Participant

    Using inline-blocks or float would definitely solve your problem. Is there any specific reason you’re using table formating?

    #131842
    jacorre
    Participant

    I am using a grid system with rows and columns of divs (no tables). I believe I have found a solution. At the end of the loop I can close the tags by checking if the modulus equals zero or not. Thanks!

    #131843
    __
    Participant

    ahhh, `%`.

    : )

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Back End’ is closed to new topics and replies.