Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to insert page break to html(php) page? 1

Status
Not open for further replies.

alan123

MIS
Oct 17, 2002
149
US
I want to know is there a way to insert page break into html/php page for printing use? if so, will it depend on the printer settings?

Thanks for any reply.
 
alan123,

You can use CSS to perform this. The basic syntax is this:

Code:
<table style="[blue]page-break-after: always;[/blue]">
  <tr>
    <td>Page breaks after this table</td>
  </tr>
</table>
or
Code:
<div style="[blue]page-break-before: always;[/blue]">Page breaks before here</div>
You can use this style on any block-level element, though you'll want to test in different browsers. Support of this style may not be universally implemented yet. You can find the full explanation along with all possible values of these styles here:
-Ron

We all play from the same deck of cards, it's how we play the hand we are dealt which makes us who we are. -Me

murof siht edisni kcuts m'I - PLEH
 
Thanks for your reply.
I tried to use CSS to break html printing pages, it works, but the only thing is if the previous page is short, that page will move down to the middle of the paper(it should be printed on the top), I tried to set topmargin=0 to html file, but it doesn't take, how I can fix this issue? thanks.
 
alan123. I am exactly where you were on Mar 12, 2004. Have you had any luck getting the previous page to print (normally) at the top of the page? Any recommendations? Thanks. TM.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top