enrii.blog

A passionate programmer’s findings in the world of internet.

Page Break for Printed Web Pages

May 6th, 2007

After I get my invoice to be printed differently from screen, I need to have page breaks for invoices that have more than 1 page. The way to achieve it, is to use CSS, again.

It's just as simple as putting the following code at wherever you need the page break:

<div style="page-break-after: always;"></div>

Also note that there's also page-break-before which you can specify a page break before some tags.

If my article helped you solved your problem, consider buy me a beer!

Share this article: del.icio.us | digg it

Tags:

Related posts:

3 Responses


LcF says:

Interesting. That’s the CSS we seldom use but sure useful for web developers :)


gbyeow says:

Haha. I remember having this same conversation with you on how to do this a long long time ago. That time WL was trying to do the same thing for her reports. Glad you finally found some use for the thing.


EngLee says:

LcF,

There’s actually quite a lot of people using it. See gbyeow’s comment!

gbyeow,

That was N years ago! Our discussion at that time really saves me a lot of time to find solution for my problem.