Page Header/Footer in HTML
-
Is there a way to put Page Header and Footer in an HTML file. Whie viewing the file it may or may not be displayed, but while printing it should be displayed on each and every page. How to do it. PLease if any suggesstions.
-
Is there a way to put Page Header and Footer in an HTML file. Whie viewing the file it may or may not be displayed, but while printing it should be displayed on each and every page. How to do it. PLease if any suggesstions.
Hi, This is really something that you probably need to do using CSS, with an alternate stylesheet - CSS2 has some support for print layout and there are moves to improve on this, but I'm not sure what the current browsers support. You could do it with XSLT (if your source is XML), and generate different pages for browsing/printing, but this would be v. complex I suspect. You could even use XSLF for generating a PDF for strict layour printing, I would think this can get even more complex. Unless you're really in to XSL .... I think your best bet is to have a search for articles on css printing. Cheers Phil Hobgen barbari.co.uk Southampton, UK
-
Is there a way to put Page Header and Footer in an HTML file. Whie viewing the file it may or may not be displayed, but while printing it should be displayed on each and every page. How to do it. PLease if any suggesstions.
hi there, I seriously doubt there is CSS support for this. Wait for CSS3 ;) Well, assuming you have similar structure for all your pages (let say it starts with paragraph of CSS class MyP), you can easily specify something like
@media print { MyP:before{ content:'header'; position:absolute; left:0; top:0; } }
For details look at w3c.org... hope it helps David Never forget: "Stay kul and happy" (I.A.) -
hi there, I seriously doubt there is CSS support for this. Wait for CSS3 ;) Well, assuming you have similar structure for all your pages (let say it starts with paragraph of CSS class MyP), you can easily specify something like
@media print { MyP:before{ content:'header'; position:absolute; left:0; top:0; } }
For details look at w3c.org... hope it helps David Never forget: "Stay kul and happy" (I.A.)Hi, Thnaks for ur valuable guidance. But I am currently using IE-6 and I am trying out something like: @page { margin: 10%; @page-top { margin-right: 5%; text-align: right; content: "Header"; } } Now I want that this text "Header" should be printed as header on each and every page as header. Now do we need to say class="@page" or something like that to apply this style sheet. Help.
-
Hi, Thnaks for ur valuable guidance. But I am currently using IE-6 and I am trying out something like: @page { margin: 10%; @page-top { margin-right: 5%; text-align: right; content: "Header"; } } Now I want that this text "Header" should be printed as header on each and every page as header. Now do we need to say class="@page" or something like that to apply this style sheet. Help.
hi, dotnetquery wrote: But I am currently using IE-6 :doh: I start to think that I completely misunderstood your problem... Are you talking about same header & footer as where IE shows page number, filename etc.? AFAK that's not HTML or CSS thing... I guess it's browser feature... Possibly there is script / ActiveX or something... quick Google search found this[^] keep your eye on this thread[^] As for your CSS style, there is CSS that appears to work for me (in FF)- it should add text to the beginning of every page... anyway I don't know if this is what you are looking for. Nevermind, IE appereantly does NOT support it :((
<style type="text/css"> body:before { content: "Header"; font-weight:bold; position:absolute; left:0; top:0; } </style>
best regards, David Never forget: "Stay kul and happy" (I.A.)
-
hi, dotnetquery wrote: But I am currently using IE-6 :doh: I start to think that I completely misunderstood your problem... Are you talking about same header & footer as where IE shows page number, filename etc.? AFAK that's not HTML or CSS thing... I guess it's browser feature... Possibly there is script / ActiveX or something... quick Google search found this[^] keep your eye on this thread[^] As for your CSS style, there is CSS that appears to work for me (in FF)- it should add text to the beginning of every page... anyway I don't know if this is what you are looking for. Nevermind, IE appereantly does NOT support it :((
<style type="text/css"> body:before { content: "Header"; font-weight:bold; position:absolute; left:0; top:0; } </style>
best regards, David Never forget: "Stay kul and happy" (I.A.)
Hi, I tried implementing this code in my file containing a table with data spanning two pages. But when I tried to view the print preview of it, it showed me header only on the first page and not every page. If I modify the tag as body:after, the text moves to the last after the table gets finished and not on every page. Also is it possible to modify the text that we can modify from page setup, with the help of scripts or ActiveX. Also I want to have images as Headers and footers instead of text.
-
Hi, I tried implementing this code in my file containing a table with data spanning two pages. But when I tried to view the print preview of it, it showed me header only on the first page and not every page. If I modify the tag as body:after, the text moves to the last after the table gets finished and not on every page. Also is it possible to modify the text that we can modify from page setup, with the help of scripts or ActiveX. Also I want to have images as Headers and footers instead of text.
dotnetquery wrote: I tried implementing this code in my file containing a table with data spanning two pages. But when I tried to view the print preview of it, it showed me header only on the first page and not every page. If I modify the tag as body:after, the text moves to the last after the table gets finished and not on every page yeah, that's actually expected result :-O As I admited in last post, I misunderstood your intention.. was more thinking about web page footer (page= like file/document) and missed part "should be displayed on each and every page." IMO that's not job for current CSS. dotnetquery wrote: Also is it possible to modify the text that we can modify from page setup, with the help of scripts or ActiveX. I belive it is. try google or MSDN, since we are talking about IE features here. I don't have experiences with it :( dotnetquery wrote: Also I want to have images as Headers and footers instead of text. :omg: Have you seen it somewhere? I doubt it is possible... I still don't have a clear picture of what you are doing, maybe you should consider other formats then HTML... p.s you see that? two more posts and we'll get 2000th :cool: David Never forget: "Stay kul and happy" (I.A.)
-
Is there a way to put Page Header and Footer in an HTML file. Whie viewing the file it may or may not be displayed, but while printing it should be displayed on each and every page. How to do it. PLease if any suggesstions.
You can do that with CSS2 you have to use the media type, Define a media type of 'Print' for the header and footer and set visibility: none you can find a full details http://www.w3schools.com/css/css\_mediatypes.asp
-
You can do that with CSS2 you have to use the media type, Define a media type of 'Print' for the header and footer and set visibility: none you can find a full details http://www.w3schools.com/css/css\_mediatypes.asp