Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to Check If Bootstrap Last Column is Even or Odd

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 527
    Answer it

    Im new to this forum and new to php too… hope i get some help…


    I have bootstrap column in while loop, what i want is if bootstrap last column is odd then i want column to be 12 (col-12), i found the way to check number even or odd but want to check last number so if last number (last column) is odd i want column to be 12 else remain col-6 i have tried:

     

    <div class"<?php echo ($i == (2 || 4 || 6) )?'col-md-6':'col-md-12'; ?>">
           display content there in while loop
        </div>
    
       <div class" <?php echo ($i % 2 == 0)?'col-md-6':'col-md-12'; ?>">
       display content there in while loop
        </div>

     

 0 Answer(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: