Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    May 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    SIMPLE HTML Quesiton

    Hi
    Can anyone tell how to get the title or header contents on every page when I print my html page? And this title content is of different font campared to the boday content and has two lines.

    Something like this:

    cust id # : 295739 Your Name : xxxx xxxxx page 1 of 5
    a/c # : 0003238230 Spouse : xxxx xxxxxxx

    Some html contents blah blah blah........
    Some html contents blah blah blah........

    Some html contents blah blah blah........
    Some html contents blah blah blah........
    Some html contents blah blah blah........

    Where cust id and a/c# are the 2 lines for title content.

    Please, help me.

    Thanks
    Suri

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    You can have them on the page already but set their display to none then use a print stylesheet to set their display to block or inline.
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Untitled Document</title>
    <style type="text/css" media="screen">
    .print {
    display:none;
    }
    </style>
    <style type="text/css" media="print">
    .print {
    display:block;
    }
    </style>
    </head>
    
    <body>
    <div class="print">This will not show in a browser but will show when printed</div>
    </body>
    </html>
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    New to the CF scene
    Join Date
    May 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks _Aerospace_Eng_ for the reply.

    But thats not I want.

    The sentence "This will not show in a browser but will show when printed" will only show on my first page, but I wanted it in all my pages and remember I dont know where exactly my page will break.

    Basically what I need is, the sentence within <TITLE> tag "Untitled Document" does show on all the pages when printed, but am not able to customize it with a different font/size and ofcourse unable to show 2 lines.

    Can you or someone else help me on this?

    thanks
    Suri

  • #4
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    The only HTML that has a facility for placing something on every page is by using the thead and tfoot tags within a table. Unfortunately not all browsers support this properly yet (do any?).

    The only place where this can be successfully done is in the browser itself where you can tell your browser what headers and footers to display on each printed page including some info from the page itself. This would be up to your visitors to set up though.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


  •  

    Posting Permissions

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