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
Splitting page content into multiple constant sized divs.
Old 06-16-2010, 08:44 AM Splitting page content into multiple constant sized divs.
Junior Talker

Posts: 3
Trades: 0
So what I'm trying to do is to create a "print version" page which grabs the content from an external page, loads it in, and formats it to be printed.

So it'll be something like this:



However, the problem is the actual "splitting" of the page. Each div must continue where the previous one left off, but I don't know of any way to detect that. Also note that the pages aren't neccesarilly all text; they may contain images and tables.

Any ideas?
AndrewFM is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-16-2010, 08:54 AM Re: Splitting page content into multiple constant sized divs.
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,376
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
use a print style sheet and the :before & :after pseudo elements.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-16-2010, 09:30 AM Re: Splitting page content into multiple constant sized divs.
Junior Talker

Posts: 3
Trades: 0
Nice, that's a better way to add the headers and footers than I was using. I never heard of those psuedo-elements. However, still, I don't think you can use those to format the individual pages; you can only use them to format block elements. A header and a footer needs to be added to each printed page, not just the top and bottom of the entire print preview. However, if there is a way to format the individual print pages, please let me know. That would make this task a million times easier.

Here's really the main problem I'm having trouble with:



I'm not even sure if that's possible in any way. (Note, this may be a problem that is more suited for some different forum... I don't know, maybe javascript or something has some way to do this. I just threw it in here, because I initially thought it was most suited for the CSS forum)
AndrewFM is offline
Reply With Quote
View Public Profile
 
Old 06-16-2010, 11:09 AM Re: Splitting page content into multiple constant sized divs.
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,376
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
There's a simple answer to that.

No chance

Not clientside anyway, there is no event that occurs as the content overflows.

Well possibly, it could be done but it would be slow and fraught with all kinds of potential problems and pitfalls.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-16-2010, 11:13 AM Re: Splitting page content into multiple constant sized divs.
Phunk Rabbit's Avatar
Ultra Talker

Posts: 255
Name: John Nerush
Location: Milton Keynes, UK
Trades: 0
You could use somthing like a PHP or JS string trunication script however it would be difficult to work with line breaks.

Alternativly maybe you can work with JS getting the height of a div and trunicating more text until the div is equal to or less than the desired size.

However as Chris is saying, methods such as these or otherwise, will be bulky and not particually nice.
__________________

Please login or register to view this content. Registration is FREE

Learn professional skills from professional people, from $6.50 a month.
Phunk Rabbit is offline
Reply With Quote
View Public Profile Visit Phunk Rabbit's homepage!
 
Old 06-16-2010, 01:33 PM Re: Splitting page content into multiple constant sized divs.
Junior Talker

Posts: 3
Trades: 0
"Alternativly maybe you can work with JS getting the height of a div and trunicating more text until the div is equal to or less than the desired size."

Regardless of the fact that it'd be really inefficient, that does sounds like it'd work. Though, I think in the end, I'll probably just do away with the headers and footers altogether. :P

Thanks for all the input. Glad to know that it's pretty much impossible, so I don't keep sitting here frying my mind trying to figure this out.
AndrewFM is offline
Reply With Quote
View Public Profile
 
Old 06-17-2010, 03:44 AM Re: Splitting page content into multiple constant sized divs.
Phunk Rabbit's Avatar
Ultra Talker

Posts: 255
Name: John Nerush
Location: Milton Keynes, UK
Trades: 0
Nothing is impossible (within reason :P ) its just striking the ballence between the work involved to the reward/benifit.
__________________

Please login or register to view this content. Registration is FREE

Learn professional skills from professional people, from $6.50 a month.
Phunk Rabbit is offline
Reply With Quote
View Public Profile Visit Phunk Rabbit's homepage!
 
Reply     « Reply to Splitting page content into multiple constant sized divs.
 

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.65529 seconds with 12 queries