CSS - Showing A Hidden Div When Printing
I have 2 divs divs on a page displaying the report. On the first div, I have a form where the user can select the report options. On the second div, I simply display the options used to run the report shown on the page.
Either one or the other div is shown on the page at a time. A user can click a button, which switches an inline style (style="display: none;") on the appropriate div. Now, when I print, I never want to show div #1. Easy enough, I just set up a print.css file and set display: none; for. However, I ALWAYS want div #2 to show, but I'm not sure how to handle that. I can't seem to use the same print.css file, because if the inline style is set to none for display, it doesn't show when printing. The only way it shows if if I actually have it showing on the screen when I hit the print button. Any ideas? Hopefully I am making myself clear. Similar TutorialsIm deriving a list of photos with information from my database. I want to be able to print the webpage off without any of the information being broken up between pages. Since its coming from the database I cant just use page breaks cause then I get one image per page. Is there a solution to this? Hi, I had this working but somehow it's not working again. The problem I am having is that scroll bars are showing up in my iframe in Firefox, Opera, and Safari, but not IE7 and IE6. Here is the link: http://www.caillouette.com/NewCatsMeow/ I know I need to tighten up my style sheet, but if someone could tell me how to solve this, I would be very happy. Here's the iframe code in the index page: Code: <div id="bodyInfo"> <iframe name="mainBody" width="770" height="602" src ="body.html" scrollbars="NO" border="0"> </iframe> <!-- end #bodyInfo --></div> Hiya, This page http://www.magikwebs.co.uk/ranch/indian.html wasn't printing too good so I've set up a stylesheet for print only, and it has improved, but it still doesn't quite look right. It leaves a big gap on page 2 and misses a line out. It looks 100% fine in Firefox. I guess it's an IE bug. Anyone know what it is and how to avoid it? Thanks, John Hi ! I've read that it's possible with CSS to adapt the visual style of a web page on the output medium. If I didn't understand that completely wrong, it means that with CSS I can format a String like "Hello World" to give him font size 10 in my browser and font size 20 if i print the page. Is this correct ? Does someone of you habe any kind of coding example therefore ? That would be great TIA Gawan Hello, I was wondering how to link to print a single ID without printing anything else... thanx=) I have a page that displays text of an article. It's all contained in a <DIV>, of course. I'd like the "Print" option the allow the user to print out just the article, and not the rest of the crap on the page (ads, navigation, so on.) I know vaguely that you can have alternate style sheets for printing and other types of display, but how to include just the text in the output? I am working on a printer friendly version of web pages. Generally when you print something from web, it prints, title, url, page number, etc. I know that you can configure your browser's settings to not print that, but is there a way through css or any other way to write your style sheet in such a way that those things are not printed? Thanks, Hi, I am having problems with my code. I am trying to print a badge. So what i am doing is in one cell of the table. I have a image that i want to be centered in the cell and then i have text below the image that i want to be centered in reference to the image The image is not centered and then the text is also not centered can someone tell me what i am doing wrong Code: table { table-layout:fixed; } table.pagebreak { page-break-befo always; } table.nopagebreak { page-break-befo ; } td { width:381.73px; height:287.244px; padding-left:24.56px; border-left:white dashed 1px; border-bottom:white dashed 1px; border-collapse: collapse; } .imglineup { text-align:center; width:300px; display:block; } .textlineup { text-align:center; display:block; } .nametd { width:381.73px; text-align:center; height:287.244px; margin: 0px 50px 0px 50px; } the cell of the table is 381.73px wide and the image thats centered is 300px wide so here is my code Code: <tr > <td class="nametd" > <img src="/images/bdg.jpg" class="imglineup"><br/> <div class="textlineup"> <span style="font-size:40pt;">Joe </span><br/> <span style="font-size:40pt;">Smith</span><br/> <span style="font-size:20pt;">CEO</span><br/> <span style="font-size:21pt;">Quest Inc</span> </div> </td> thank you todd Hello, I have an issue when printing a page in IE7. The page is located at http://www.northridgeltd.com/test_site/northridge_team.php when you print, the content from two employees bunches up at the bottom of the first page. Anyone have any ideas? Thanks Is there a way to forcefully print the background of a table cell? I am generating an attendance list, and it would be kinda nice if it would print the backgrounds, just a simple grey shading to seperate the lines. Hi folks. I've just encountered some problems printing pages in Internet Explorer SP2. The pages print fine in SP1, and virtually every other browser I've tried. An example page can be found he http://www.unbc.ca/hr/jobs/staff/0504cu.html The problem under SP2 is the menu is pushed over and overlaps the main page content. Can anyone tell me if this might be caused by a quick of SP2? The fact that it renders and prints correctly in EVERY other browser I've tried leads me to point the finger at SP2, but I can't say for sure. Can anyone offer any advice on this? Cheers and thanks in advance, Pablo Hey guys, I'm working on a website and I have been notified by the client that the page does not print correctly in IE. Prints just fine in Mozilla however. I tested this and sure enough it cuts off the rightmost 100 or so pixels. The entire page exists in a table that is centered and set to be 729 pixels wide. I tried attaching an extra stylesheet: Code: <link rel="stylesheet" type="text/css" media="print" href="dummy.css"> but that has no effect. Even when I use the other stylesheet to move the content to the top left corner of the page with no borders, it still prints the page centered and lops off the rightmost 100 or so pixels. Any ideas? (telling them to print in another browser is not an option unfortunately) I have a div that contains multiple fieldsets and every two fieldsets I add a page-break-after style. After the first page prints, the legend tags for each fieldset on subsequent pages are displayed completely inside the fieldset border. My code essentially passes HTMLTidy validation. The only issues I have are unclosed input tags, alt tags for images, using the "&" sign and no title tag. If those issues aren't causing the problem, and I can't see how they are, I don't know what to check next. Has anyone seen a template somewhere that can help style a page for printing to an index card? Thanks, James Ok, I've google a bit, and come up with http://home.tampabay.rn.com/bmerkey...scape-test.html, but it seems to fail if I try printing tables in Landscape. It's for an intranet ap, using IE6 predominantly but also needs to work in Moz. Does anyone know of a way to do this with tables? I have decided to develop CSS to style my web pages for printing. So far I am getting the results I desire from Firefox 2.0. However I am having an issue with IE 6. If your open the following page in IE: cambridgema.gov/cdd/test/faq_test.html Go to print preview, move to the second print page and scroll to the bottom you will see that the page break splits a single line of text between two printed pages. Any suggestions about how to stop this? Thanks Cliff Hey there, I have a page to print a discount card - and if it is on one page there print preview works great. (ex. http://www.rxclubcard.com/your_card.php ) However, if i try to put 5 cards sequentially, and then look at the print preview, after the first page of cards the 2nd and third pages do not show the cards and the print gets screwed up. I am running a for loop just to print 5 table rows. Why does this happen? (ex. http://www.rxclubcard.com/5cards.php ) I would appreciate any help! Thanks guys Does anyone have a handy snippet I could slip into my stylesheet to make a particular (named) frame print by default? I've heard that using CSS in this way can solve the 'printing every frame' problem in IE, but my CSS knowledge is very, very rudimentary.... Thanks in advance! Hi I need to print a webpage, but I dont want it to print the date and url and title of the page on the top and bottom of the page. And also is there a way that you can print a page with buttons, without printing the buttons? Hi folks, I am working on online reporting system and was wondering if anyone could help me. The report searches through 25000 records to show a report of profit and costing etc, the problem I am having is when the client wants to print the report off they want a logo at the top of every page, the report is always different sizes depending on the search criteria they enter so Is there a way in php I can print the long report out with a header at the top of every printed page. I hope this makes sense and thanks to anyone whoe replies. LMD |