How to add a column to a row according to conditions

when index is even, add a Col to the newly generated Row when Row,index is odd


Mar.22,2021

you can also add one per click and use css to wrap


you want to be complicated, and there are two ways to do it:

  1. determine whether it is an odd number or an even number when each click is increased. If it is odd, it will be added directly after it. If it is even, it will be displayed in a new line.
  2. fixed container width, and then each increase in item width is also fixed, 50% of the container width, so that each line can only put two item, and then increase, there will naturally be the effect of line wrapping
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3e980-2c453.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3e980-2c453.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?