lets say you want to display a collection of items organised in rows and columns, and you do not want to use tables, and rather want to go with a tableless design.
This is the result you are aiming at:
item 1item 2item 3</div><!-- end row -->item 4item 5item 6</div><!-- end row -->item 7item 8item 9</div><!-- end row -->
A good way to do it would be to use the modulo operator. In PHP, you can put a counter and use the counter to change line using the modulo operator. If you want to have 3 items in the row, do $n%3, when $n%3 == 1 that means you should start a row, when $n%3 == 0 it means you should close the row…
View original post 18 more wordsAdvertisements