page break after every 5 records

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kkshansid
    New Member
    • Oct 2008
    • 232

    page break after every 5 records

    i want page break after every 5 records but my code is not working
    kindly help
    Code:
    while($row = mysql_fetch_array($result))
      {
        $i++;
      if($i%5==0){
    	  echo $i;
    
    echo"<DIV style='page-break-after:always'></DIV>"; }
    	
      ?>
                  <tr> 
                    <td><?php echo $row[address];?></td>
    </tr>
                  <?php
    			  }?>
                </table>
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    #2
    Why is it not working? Can you view source in the browser copy and paste some records of that table? is $i set to 0 before your while loop?

    I hope you didn't mean pagination, because this is not how you do it.



    Dan

    Comment

    • Dormilich
      Recognized Expert Expert
      • Aug 2008
      • 8694

      #3
      Code:
      <DIV style='page-break-after:always'></DIV>
      does your User Agent actually support this?

      Comment

      Working...