Page breaks

Discussion in 'HTML' started by MW de Jager, Apr 5, 2005.

  1. MW de Jager

    MW de Jager Guest

    Hi

    I'm programming in Delphi and use HTML for reporting and printing. Problem
    is this. The HTML documents contain a varying number of tables, of
    different sizes. The documents also may contain text that wraps around at
    the end of line. When I try to print the HTML, the tables often end up
    being broken over two pages. What can I do, to force Internet Explorer, to
    print a table on the next page if it will not fit on the current page, when
    it is being sent to the printer?

    Any help wil be appreciated
    MW
     
    MW de Jager, Apr 5, 2005
    #1
    1. Advertising

  2. MW de Jager

    Nico Schuyt Guest

    MW de Jager wrote:
    > .. What can I do, to
    > force Internet Explorer, to print a table on the next page if it will
    > not fit on the current page, when it is being sent to the printer?


    I'm affraid that is impossible. Maybe it's an improvement to add a page
    break before the table:
    table {page-break-before: always}

    --
    Nico
    http://www.nicoschuyt.nl
     
    Nico Schuyt, Apr 5, 2005
    #2
    1. Advertising

  3. MW de Jager

    Andy Dingley Guest

    On Tue, 5 Apr 2005 08:45:16 +0200, "MW de Jager"
    <> wrote:

    >I'm programming in Delphi and use HTML for reporting and printing.


    >When I try to print the HTML, the tables often end up
    >being broken over two pages.


    You have two avenues of approach, CSS and the page-break rules (sadly
    poorly supported) and also you're generating the content from a
    useful programming language. You can do some reasonable estimation of
    page location for each row and then apply classes to relevant lines of
    the output HTML to invoke CSS that strongly hints "page-break-after :
    always" or "page-break-before : avoid"

    You can also use a CSS media rule to set the font-size for printing in
    points, rather than ems (as you'll be using on screen)

    There will now be a flurry of posters to point out that you can't do
    this in HTML, They're right of course, but this isn't HTML - it's HTML
    intended for print. You know the page size (ignoring margins and US
    letter paper) and you have a good probablility of knowing the text
    size in points. Within this constraint of print targetting, then you
    can certainly improve mattes.


    --
    Smert' spamionam
     
    Andy Dingley, Apr 5, 2005
    #3
  4. MW de Jager

    Adrienne Guest

    Gazing into my crystal ball I observed Andy Dingley
    <> writing in
    news::

    > On Tue, 5 Apr 2005 08:45:16 +0200, "MW de Jager"
    ><> wrote:
    >
    >>I'm programming in Delphi and use HTML for reporting and printing.

    >
    >>When I try to print the HTML, the tables often end up being broken
    >>over two pages.

    >
    > You have two avenues of approach, CSS and the page-break rules (sadly
    > poorly supported) and also you're generating the content from a
    > useful programming language. You can do some reasonable estimation of
    > page location for each row and then apply classes to relevant lines of
    > the output HTML to invoke CSS that strongly hints "page-break-after :
    > always" or "page-break-before : avoid"
    >
    > You can also use a CSS media rule to set the font-size for printing in
    > points, rather than ems (as you'll be using on screen)
    >
    > There will now be a flurry of posters to point out that you can't do
    > this in HTML, They're right of course, but this isn't HTML - it's HTML
    > intended for print. You know the page size (ignoring margins and US
    > letter paper) and you have a good probablility of knowing the text
    > size in points. Within this constraint of print targetting, then you
    > can certainly improve mattes.
    >
    >


    I would add to that, if you are using different margins or if you have
    navigation, copyright, header information that you do not want printed,
    this is what I do:

    @media screen {
    #nav {...}
    #footer {...}
    #copyright {...}
    #content {margin-left:20%}
    }
    @media print {
    #nav, #footer, #copyright {display:none}
    #content {margin:0}
    }

    --
    Adrienne Boswell
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
     
    Adrienne, Apr 5, 2005
    #4
  5. MW de Jager

    Andy Dingley Guest

    On Tue, 05 Apr 2005 18:15:18 GMT, Adrienne <>
    wrote:

    >I would add to that, if you are using different margins or if you have
    >navigation, copyright, header information that you do not want printed,
    >this is what I do:


    I do a lot of that too, but I tend to do it by putting "print-only"
    and "no-print" classes onto the HTML. I do it for a major page
    component like "nav-menu" of "advertising-banner" and such, but I
    wouldn't do it for something smaller like "copyright". I might
    sometimes want to print that, so I'd rather keep the specificity in
    the HTML, rather than the CSS.

    I'm also not that keen on using ids rather than classes for top-level
    structure like "footer". An id has a high value in a CSS selector
    compared to a class, and this makes it difficult to sub-class CSS
    behaviour by applying another class to elements within it.

    --
    Richard Nixon. A great man who gave the world many things; detente with
    China, withdrawal from Vietnam, and an inexhaustible supply of cheap
    newspaper headlines, all ending in "Gate"
     
    Andy Dingley, Apr 5, 2005
    #5
    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. darrel

    userControl breaks on 404 page?

    darrel, Aug 10, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    390
    darrel
    Aug 10, 2004
  2. EDom

    Page breaks

    EDom, Jul 19, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    501
    Curt_C [MVP]
    Jul 19, 2005
  3. tomh

    Repeater and Page Breaks

    tomh, Sep 7, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    1,720
    comradekev
    Oct 3, 2005
  4. AV

    Page Number and Page Breaks

    AV, Oct 28, 2003, in forum: ASP General
    Replies:
    4
    Views:
    163
  5. Orion Forever

    Managing Page Breaks in an ASP Page

    Orion Forever, May 1, 2009, in forum: ASP General
    Replies:
    2
    Views:
    154
    Orion Forever
    May 1, 2009
Loading...

Share This Page