How to add a page break to a HTML page

Discussion in 'HTML' started by Stefan Mueller, Mar 9, 2006.

  1. According to the data in a MySQL database I'd like to generate a HTML page
    by PHP. The HTML page lists several invoices.

    For example:
    Invoice - Robert Miller
    ...
    ...

    Invoice - John Meyer
    ...
    ...

    Now I'd like to add a page break between each invoice so that I get one
    invoice per page if I print the HTML page on a printer.

    How can I do that?
    Stefan
     
    Stefan Mueller, Mar 9, 2006
    #1
    1. Advertising

  2. Stefan Mueller

    Toby Inkster Guest

    Stefan Mueller wrote:

    > Now I'd like to add a page break between each invoice so that I get one
    > invoice per page if I print the HTML page on a printer.


    Invoice 1
    <hr>
    Invoice 2
    <hr>
    Invoice 3

    with CSS:

    HR {
    page-break-after: always;
    }

    For the most part, CSS print-specific stuff is fairly badly supported by
    most browsers (except Opera, which has excellent CSS support), however,
    page-break-after and page-break-before are fairly widely supported.

    http://www.westciv.com/style_master/academy/browser_support/printing.html

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
     
    Toby Inkster, Mar 9, 2006
    #2
    1. Advertising

  3. > HR {
    > page-break-after: always;
    > }


    Works not bad.

    Many thanks
    Stefan
     
    Stefan Mueller, Mar 10, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Danny Ni

    Insert a page break in HTML

    Danny Ni, Nov 18, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    20,375
    =?Utf-8?B?QWxhbiBMYW1iZXJ0?=
    Nov 18, 2004
  2. Replies:
    15
    Views:
    6,170
    Gernot Frisch
    Jun 12, 2006
  3. rehanbasar

    HTML Page Break Problem

    rehanbasar, Jun 6, 2007, in forum: HTML
    Replies:
    1
    Views:
    1,931
    Jukka K. Korpela
    Jun 6, 2007
  4. Replies:
    12
    Views:
    968
  5. Gelonida N
    Replies:
    0
    Views:
    202
    Gelonida N
    Sep 10, 2011
Loading...

Share This Page