Wednesday, 24 September 2014

PHP % Function for displaying image or paragraph in Div to fix as same height


By using this % PHP Function while displaying image or paragraph in dynamically the div height is in different
so we will use the PHP % function to make that has correctly.


$select=mysql_query("select * from tbl ");
$c = 1;-->Intiliaze for % as 1
if($c%3 == 0) {
echo '<div class="clear"></div>';

} ?>


     1. In CSS we have to call the calss like .clear{clear:both;}
     2. if($c%3 == 0)-->it will dispaly only three columns in the page
       after getting three rows automatically it will form a new line
3. $c++-It will incerment the rows

No comments:

Post a Comment