SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard
    Join Date
    Dec 2004
    Location
    USA
    Posts
    1,407
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    IE is printing a blank page at the end

    I view the same page in IE and Firefox. When I print the page, IE prints an extra blank page at the end while Firefox prints correctly and does not.

    Any ideas?

    Here's the end of the source page:
    HTML Code:
    <body>
    <FORM>
    <INPUT TYPE="button" onClick="window.print()" value="Print This" class="prnt">
    </FORM>
    <div class="schedules">	<table class="dataTable">
    <tr><th scope="col" colspan="4">Title</th><th scope="col" colspan="4">As of: November 01, 2007</th></tr>
    <tr><th scope="col"></th><th scope="col">Description</th><th scope="col">Serial #</th><th scope="col">Value</th><th scope="col">Date Added<br />Stopped</th><th scope="col">Cost</th></tr>
    <tr><td class="property_columns">1</td><td class="property_columns">LAPTOP COMPUTERS</td><td class="property_columns"></td><td class="property_columns">$200</td><td class="property_columns"><br /></td><td class="property_columns">$75</td></tr>
    ....
    <tr><td colspan="7">text here</td></tr>
    </table>
    </div><!--End of div tag-->
    </body>
    </html>
    And here's the stylesheet:
    HTML Code:
    @CHARSET "ISO-8859-1";
    body {
    	font-family: Verdana, Arial, Helvetica, sans-serif;
    	font-size: 10px;
    	margin: 10px;
    	padding: 0;
    }
    .header1{width: 100%;font-size: 20px;font-weight: bold;text-align:center;}
    .header2{width: 100%;font-size: 14px;text-align:center;}
    .header3{width: 100%;font-size: 11px;text-align:center;}
    
    .schedules{display:block;page-break-after:always}
    
    .dataTable{width: 100%;border-collapse: collapse;}
    .dataTable td{padding: 6px;margin: 0px;}
    .dataTable td.property_columns{width:80px;border-top:1px solid #CCCCCC;}
    .dataTable th{font-weight: bold;text-align: left;font-size: 10px;background-color: #DDDDDD;border-bottom: medium double #000000;}
    Last edited by WebDevGuy; Oct 26, 2007 at 07:58.

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,290
    Mentioned
    198 Post(s)
    Tagged
    3 Thread(s)

    print CSS

    I use a seperate style sheet for print, to remove non-screen elements.
    I wonder if
    Code:
    .schedules{display:block;page-break-after:always}
    adds a page break, and the 2nd page is the
    Code:
    body {
    .....
    	margin: 10px;
    Also, AFAIK printers may not know what a pixel is, so this might have something to do with it too.

  3. #3
    SitePoint Wizard
    Join Date
    Dec 2004
    Location
    USA
    Posts
    1,407
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've removed the ending body and HTML tags and even the ending DIV tag, tried removing the margin in body tag - still the same problem.

  4. #4
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,290
    Mentioned
    198 Post(s)
    Tagged
    3 Thread(s)

    page break

    I tried print with Opera. It used another page as well. Then I tried it without the
    page-break-after:always
    It then only prints 1 page in IE and Opera.
    I don't know why the browser would want to print a page with nothing on it (unless it's "printing" white-space). Do you need that in the CSS?
    Supposedly page-break-after is supported in IE, Firefox, and Opera, so I don't know what's different with Firefox here.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •