Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print.css and auto scroll div

Status
Not open for further replies.

Linda224

Programmer
Dec 6, 2006
80
US
I have a page that has an auto scroll on a div to prevent the page from being a mile long however when the page is printed it only prints what is in the current window. Is it possible to have the print.css show the entire div without the scroll?
Thank you for any help
 
Hi

I suppose there is a size restriction on that [tt]div[/tt]. Resetting it will probably solve the problem.

If you want an answer without "suppose" and "probably", show us that page. ( The best would be an URL to it. )


Feherke.
 
unfortunately I cant give you the link to the page but this is what I have. Just let me know if you need more.

in the main.css for the div I have this:

#detailsgrid
{
width: 780px;
height: 500px;
overflow: auto;
}

In the print.css I have this:

#detailsgrid
{
overflow: visible;
height: 1000px;
}

But it still does not print the entire contents of the div

Thank you

 
The hiding of the other stuff from the print works:

#scrolling, #header, #headerright, #sub-header, #sub-header-nav, #sidebar {
display : none;
}

its just the content of the scrolling div that doesn't show up
 
Hi

Yes, something like that is what you have to use.

However putting dumb value of 1000px may be enough or not :
[ul]
[li]if is not enough, part of the [tt]div[/tt] convent will overlap the content which follows it[/li]
[li]if is too much, will push the content which follows it down, leaving an empty area[/li]
[/ul]
Better set [tt]height: auto;[/tt] .


Feherke.
 
Yeah I tried the height: auto; but that is not working either.
There isn't anything below the div that I'm concerned about pushing down.

Is this something that could be done with javascript or something?


 
have you thought about the print option opening a print formatted version of the page. this would just require a small adjustment to your style and the user can then print that page.

Darryn Cooke
| Marketing and Creative Services
 
Vragabond - I deleted the references to other style sheets and I'm still getting the same result. There is a detailsview in the div does that make a difference?

darryncooke - What would that small adjustment be? Thank you
 
Oh I just figured it out.

In my reference to the print.css I had media="print" but I did not have media="screen" on the main.css.
It works now
Thank you
 
oops I didn't read all the posts completely as it looks like you have a print stylesheet which makes the target content visible.

I was going to ask you for your link syntax but it looks like you figured it out.

Darryn Cooke
| Marketing and Creative Services
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top