简体   繁体   中英

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

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" />

This worked for me:

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM