/    Sign up×
Community /Pin to ProfileBookmark

Page breaks for printer

Hello,

I want to control page breaks on the web-page.
I have header and a paragraph on my page. Is there any way that I could club them together for printing in such a way that either both come on same page. If at end of page, there is just enough space for header to fit, but not paragraph, then header should also go on next page.

I have header and paragraph in 2 consecutive rows of a table.

I tried page-break-after:avoid but thats not working. page-break-after/before:always is working, but ‘avoid’ is not.

Is there anything I have to install or point to in order to tell browser to use CSS2? I would be happy even if it starts working in IE 6.X.

Any help is highly appriciated. Have been trying this and reading about it on web since last 2/3 days.

Thanks,

_Uttara

to post a comment
CSS

3 Comments(s)

Copy linkTweet thisAlerts:
@David_HarrisonDec 12.2005 — Surely you'd need to use this:page-break-inside:avoid;As opposed to page-break-after/before.
Copy linkTweet thisAlerts:
@UttaraauthorDec 12.2005 — I did try that. Thats not working for me.

for which tag should I specify page-break-inside:avoid?

I tried it for table, tr, td and didn't work.
Copy linkTweet thisAlerts:
@vishnuJan 05.2006 — Hi,

I am in need of printing web pages with proper formating.so, I request u all to help me in solving this problem by suggesting how can I proceed to do.

I am using the javascript in jsp file asa

javascript:window.print();,I am able to open the dialoue for print, but not able to set the page orientation as Landscape and page-break.Please do send me the guidelines to follow and with an example if possible.

I am using IE 5.5+

my personal emailid : [email][email protected][/email]

this will be great help 4 me and thanks in advance.

thanks,

vishnu
×

Success!

Help @Uttara spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...