Forum Moderators: open

Message Too Old, No Replies

Print Page

What is the best option

         

Visit Thailand

6:19 am on May 29, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I get complaints sometimes that when someone prints a page on one of my sites they end up with all the pictures and links etc that they say they do not want.

Of course what I could do is create a second page with no graphics and links and then place a printable button on the original page that opens the printable page in a new window. This though would be very time consuming.

Can anyone else recommend another method or any suggestions ?

I should mention all my pages are .shtml or .htm

Nick_W

6:38 am on May 29, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well if you've marked up all your pages using <div>'s and css layout then it's very easy:

Say you have 3 divs


  • header // containing top navigation and logo
  • leftnav // links and stuff
  • content // your content with photos (with #id's )

then in your css just do something like this:

@media print {

#header {
display: none;
}

#leftnav {
display: none;

#content img {
display: none;
}

}

and of course you can set your body margins and font sizes and anything else you need to.

If you have a table based layout then probably the best you could do would be to wrap certain elements like photos in divs (or just give 'em id's ) and do as above. But there is no easy way that I can see ;-(

Nick

Visit Thailand

6:46 am on May 29, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks Nick_W

Unfortunately this site I am working on was first designed for a bit of fun, and has since become huge and popular, the problem is that it does not use CSS.

But everything is built into tables so perhaps I will give that option a go.

Thanks
Somkiat

Nick_W

6:57 am on May 29, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



One thing you might try Somkiat is: if you use a server-side scripting environment like php then you could create a script to strip out all table and img tags?

Just a thought....