...

View Full Version : SIMPLE HTML Quesiton



suri
05-03-2006, 05:00 PM
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

_Aerospace_Eng_
05-03-2006, 05:06 PM
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.

<!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>

suri
05-03-2006, 09:49 PM
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

felgall
05-04-2006, 02:51 AM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum