Page break in a word using html

I create documents with php in word and pdf format

I use headers to create a document in a word

header("Content-type: application/vnd.ms-word");
header("Content-Disposition: attachment;Filename=example.doc");
echo "<html>";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=Windows-1252\">";
echo "<body>"; etc etc

wysiwyg generates the following code to render pages

<div style="page-break-after: always;"><span style="display: none;">&nbsp;</span></div>

This html / css works fine for pdf output, but not for word.

Can someone recommend an alternative method for creating page breaks that might work in a word.

+6
source share
4 answers

A question was asked some time ago, but I am adding this for reference:

I had the same problem and I was able to make a page break with this code

<br style="page-break-before: always">

The only way I could get it to work was with the br element and the style of its inline.

+20

, , Microsoft , .

Word , .. . HTML , + .

, Word 2000 Word 2003, Word 2007, Word 2010.

Word, , Microsoft. : Outlook 2003 Internet Explorer HTML-, Outlook 2007 Word. HTML- Outlook 2003 Outlook 2007.

+1

( ) MS Word 2000-2007 (, , ):

1) <br clear=all style='page-break-before:always'>

2) &#12;/* Ctrl-L = FF */

0
<pre><br clear=all style='mso-special-character:line-break;page-break-before:always'></pre>

, .

0

All Articles