Css Page break causing extra page break after table in IE

I have the following html file...these are the entire contents:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1">
<style type="text/css">
    P.breakhere
    {            
        page-break-after: always;
    }
</style>
<title></title>
</head>
<body>
<table>
    <tr>
        <td>
            [Contents of page 1]
            <p class="breakhere" style="width: 100%; text-align: right; font-weight: bold;">
                Continued...
            </p>
            [Contents of page 2]
        </td>
        </tr>
    </table>
    [More of page 2]
</body>
</html>

This is printing as 3 pages in IE 8 (version: 8.0.7601.17514) installed on Windows 7 Professional SP1

This should only be printing as 2 pages, but an additional pagebreak is inserted after the table element is closed.

Any suggestions?

Answers


There is an issue with the page-break-before (or page-break-after) being set on an element inside of a table.

There is no workaround. It will cause unexpected behavior. I had to change around the layout of the page to avoid this issue.


Try using:

page-break-inside:avoid

http://www.w3schools.com/cssref/pr_print_pagebi.asp


Need Your Help

'LIKE' Query Algorithm

algorithm search information-retrieval

I have a problem with like-query in my project.The requirement is 'like' srarch in about 10million name, for example:

Stop GPS and disable GoogleApiClient

android google-maps

I am building an app to help keep up with your bar tab while you are out on the town. I have a feature where the user can set a proximity alarm (a Geofence) to remind them to close their tab if they