Click here to get back home

Don't print certain elements from a page

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Don't print certain elements from a page Otto Wyss 02-17-2007
Posted by Otto Wyss on February 17, 2007, 3:38 pm
Please log in for more thread options


I'd like to print a page but would exclude all elements but one (a
table). I've successfully removed all elements from printing with a
print.css

@page { size: portrait; margin: 2.5cm 1cm 1.5cm 1.5cm; }
* {
display: none;
}

yet that doesn't produce the desired result. How do I include the single
table I'd like to print? Or do I have to remove any none print element
by itself? How should I do this?

O. Wyss

--
Cross-platform applications:
http://wyoguide.sf.net/index.php?page=projectlist.php

Posted by Rik on February 17, 2007, 3:46 pm
Please log in for more thread options



> I'd like to print a page but would exclude all elements but one (a
> table). I've successfully removed all elements from printing with a
> print.css
>
> @page { size: portrait; margin: 2.5cm 1cm 1.5cm 1.5cm; }
> * {
> display: none;
> }
>
> yet that doesn't produce the desired result. How do I include the single
> table I'd like to print? Or do I have to remove any none print element
> by itself? How should I do this?

Depends on the page layout. * will select 'body', so this wil have no
display, whatever you set subelements to. I usually can turn elements on &
off by their id, so a default print.css for me usually looks something
like:

#header,#footer,#navigation
#content

--
Rik Wasmus

Posted by Otto Wyss on February 19, 2007, 4:26 am
Please log in for more thread options


Rik wrote:
>
>> I'd like to print a page but would exclude all elements but one (a
>> table). I've successfully removed all elements from printing with a
>> print.css
>>
>> @page { size: portrait; margin: 2.5cm 1cm 1.5cm 1.5cm; }
>> * {
>> display: none;
>> }
>>
>> yet that doesn't produce the desired result. How do I include the single
>> table I'd like to print? Or do I have to remove any none print element
>> by itself? How should I do this?
>
> Depends on the page layout. * will select 'body', so this wil have no
> display, whatever you set subelements to. I usually can turn elements on &
> off by their id, so a default print.css for me usually looks something
> like:
>
> #header,#footer,#navigation
> #content
>
Yes, but you have to give all your headers on each page the id "header"
or use separate print.css for different pages. I'd like a more general
solution if possible.

O. Wyss
--
Cross-platform applications:
http://wyoguide.sf.net/index.php?page=projectlist.php

Posted by Rik on February 19, 2007, 4:34 am
Please log in for more thread options


> Rik wrote:
>>> I'd like to print a page but would exclude all elements but one (a
>>> table). I've successfully removed all elements from printing with a
>>> print.css
>>> @page { size: portrait; margin: 2.5cm 1cm 1.5cm 1.5cm; }
>>> * {
>>> display: none;
>>> }
>>>
>>> yet that doesn't produce the desired result. How do I include the
>>> single table I'd like to print? Or do I have to remove any none print
>>> element by itself? How should I do this?
>>
>> Depends on the page layout. * will select 'body', so this wil have no
>> display, whatever you set subelements to. I usually can turn elements
>> on & off by their id, so a default print.css for me usually looks
>> something like:
>> #header,#footer,#navigation
>> #content
>
> Yes, but you have to give all your headers on each page the id "header"
> or use separate print.css for different pages. I'd like a more general
> solution if possible.

Well, same layout, same id's. Other layout, other id's, and ofcourse
another stylesheet. You can fiddle about with javascript, wouldn't
recommend it though.
--
Rik Wasmus

Similar ThreadsPosted
To print a HTML page as I want October 30, 2004, 3:09 pm
Re: print form value on the web page etc? January 23, 2008, 5:47 am
HTML Reports, want to print the report heading on each page... November 15, 2004, 12:01 am
Can you add additional elements to XHTML 1.0 page? May 19, 2005, 9:51 am
html for print January 2, 2006, 5:00 am
Redisplaying for print February 25, 2006, 9:31 am
Print CSS Not Loading September 20, 2007, 12:41 pm
Format print using html? Please help October 5, 2004, 1:13 pm
frames print button January 25, 2007, 11:18 pm
Print versions of HTML cut off at margins September 14, 2004, 9:01 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap