keeping records from being split when printing (almost solved)

3 posts by 2 authors in: Forums > CMS Builder
Last Post: June 16, 2010   (RSS)

By gkornbluth - June 11, 2010 - edited: June 12, 2010

Hi all,

If someone has a better approach I hope they'll share it.

I'm using CSS to keep address book records from being split when printed from a web page.

I’d prefer to use the CSS "page-break-inside: auto" but it’s not supported by most browsers, so I’m trying to get by with "page-break-after: always".

Here’s the code that I came up with.

<?php $count1 = 0; ?>

<?php foreach ($my_tableRecords as $record ): ?>
<?php $count1++; ?>
<table >
<tr>
<td>
<?php echo $record['first_name'] ?>, <?php echo $record['last_name'] ?><br />
<?php echo $record['street_address'] ?>, <?php echo $record['city'] ?> <?php echo $record['state'] ?> <?php echo $record['zip'] ?><br /><br />
</td>
</tr>
</table>
<?php endif ?>

<?php if ($count1 >6): ?><p style="page-break-after: always"></p>
<?php $count1++; ?>
<?php endif ?>

<?php endforeach; ?>


Hope this helps someone else.


Now all I have to do is deal with book format page printing.

This one's going to be "interesting"...

2 - 5.5 x 8.5 pages on an 8.5 x 11 sheet, with the correct ones printing on the left, right, front and back so the stack comes out of the printer collated and ready for folding and stapling.

If anyone has a great idea... Please pass it on.

Best,

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [gkornbluth] keeping records from being split when printing (almost solved)

By Jason - June 16, 2010

Hi Jerry,

Have you made any progress with this? Is it just a matter of formatting the margins?

Let me know where you are and if you need any help.

Thanks.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/