Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Make a Printer Friendly Page
Old 10-11-2007, 07:16 PM Make a Printer Friendly Page
Novice Talker

Posts: 10
Name: Ken Van Someren
Trades: 0
Hi All

I have written a simple script that pulls data from the DB and displays the results on the screen. Is there a simple way to take these results and make them available in a Printer Friendly version (Black and white, no images, etc.) by pressing a link if you wish to print them out?

Thanks,

Ken
__________________

Please login or register to view this content. Registration is FREE
kenwvs is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-11-2007, 09:44 PM Re: Make a Printer Friendly Page
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,935
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
Hi Ken,

You don't actually need a separate printer friendly link at all. Print-specific stylesheets will give you the print-friendliness you seek and will save bandwidth.

http://www.webcredible.co.uk/user-fr...ylesheet.shtml <--- this page will explain more about how to make one.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 10-12-2007, 12:10 AM Re: Make a Printer Friendly Page
Novice Talker

Posts: 10
Name: Ken Van Someren
Trades: 0
Thanks for the handy tip, it seems to work well, although I am having one problem with the page printing on only the middle 2/3 of the page, and it is cutting off the right side of the printing, which he talks about in the article, and I think I have it right. I am using a <table> to hold the results, and if I understand the article, I have taken care of it in the command below.

I am using the following command which should have it printing properly
Code:
/* Ensure the content spans the full width */
#container, #container2, #content, #c-col, #singlecontent, #table
{
width: 100%; margin: 0; float: none;
}
Interesting enough, I printed out the article, and they appear to be using the print.css stylesheet, yet his page prints in the same area as mine, and is cutting the print off on the right side also.
__________________

Please login or register to view this content. Registration is FREE
kenwvs is offline
Reply With Quote
View Public Profile
 
Old 10-12-2007, 02:10 AM Re: Make a Printer Friendly Page
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,935
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
Well dude...I'm not sure if you tried this or not, but here's how I deal with print stylesheets:

1) I start with a blank print.css file. Why? Because a blank print.css file generates a result on a page similar to that when CSS is disabled or not included (in other words, just plain ol' black Times New Roman text on a white background, unless inline styles are used.)

2) I create CSS for those elements that I want removed. For example, you want images removed.
Code:
img {
     display:  none;
}
This will remove any image from the print output. It'll be as if it were never there in the first place.

I'd do something similar to any elements I'd want removed. e.g.
Code:
div#banner-ad, div.screen-only, div#main-menu, div#left-side-menu {
     display:  none;
}
Finally, I'd add in my CSS for the paging and margins and fonts and stuff.

In other words, it's best to approach print css as if you were doing it on screen. Start blank, add your elements, check, add more elements, check, fix elements, check, add more elements, and so on and so on until you've got it right.

If you're still stuck, link to the page. There are plenty of CSS geeks in here (including the smartest CSS guru type you'll ever meet, LadyNRed) who can help you out.

A little side note here, too: while your posts do pertain to databases in the sense that you're drawing info from a database, the primary topic of the post often pertains to something else (e.g. this pertains to CSS more than anything, and it looks like your other post pertains to PHP even though I know very little about PHP.) You'll find a lot more success in posting to the forum that best fits your problem.

You're asking good questions, don't get me wrong (they **** sure beat the "i m seo expert, plz to tell me how seo my site?" or "I got screwed over 38 times on the Interweb, but the 39th time will be different, I swear, thanks to a money-making guru no one has ever heard of!" posts); you just need to work a little more on targeting the right forum, that's all.

Hey mods, can you move this one over to CSS so Ken can get some more help?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 10-12-2007, 11:36 AM Re: Make a Printer Friendly Page
Novice Talker

Posts: 10
Name: Ken Van Someren
Trades: 0
Thanks for the help on designing the stylesheet and for the tips on posting in the right area....muchly appreciated.
__________________

Please login or register to view this content. Registration is FREE
kenwvs is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Make a Printer Friendly Page
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.26431 seconds with 12 queries