av_master
av_master

Reputation: 51

HTML page break for word - page-break-before:always not working

I made a HTML for a word document and created it via file_put_contents('document.doc', $html_source);

The problem is that the style used as following:

style='page-break-before:always'

Doesn't do anything.

Any ideas or solutions?

Here is an example of what I am trying to do: http://bytes.com/topic/html-css/answers/720863-page-break-html-word-email

Upvotes: 1

Views: 2792

Answers (2)

0utR1ghtNow
0utR1ghtNow

Reputation: 21

This worked for me:

<div class=”WordSection1”></div>

I am was creating a word document from an HTML table.

Upvotes: 0

Wizard of Oz
Wizard of Oz

Reputation: 175

Microsoft Word will only recognize this style as long as it's applied to a <br /> element.

.pagebreak {
        page-break-before: always;
    }
<br class="pagebreak" />

Upvotes: 2

Related Questions