mike23
mike23

Reputation: 1312

I'm generating a word document with PHP, how do I make a page break?

I'm generating a word document with PHP (HTML with ms-word header), is there a way make a page break ?

Right now I'm witing a lot of <p>&nbsp;</p> until the page changes, but that's far from satisfying.

Upvotes: 4

Views: 2147

Answers (2)

Dandee
Dandee

Reputation: 1

A page-break has no meaning in HTML. It's more elegant to mark up the text which should be on the next page with, let's say

Header

. Then, in MS Word, create a style named "H2", and set it to "Page-break before" (Format/Paragraph/Line and Page Breaks).

Upvotes: -2

Mark Baker
Mark Baker

Reputation: 212412

I've not tested to see if it works, but you could try:

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

Upvotes: 5

Related Questions