BUG: Setting page-break-after:always for <P> Tag Causes Infinite Pagination (274554)



The information in this article applies to:

  • Microsoft Internet Explorer (Programming) 5.5

This article was previously published under Q274554

SYMPTOMS

Setting the page-break-after:always value for a <P> tag in an embedded style sheet may cause infinite pagination when you view the HTML page in Print Preview.

If you try to print the HTML page, this infinite pagination causes the IEXPLORE process to take 98 to 100 percent CPU time.

CAUSE

This problem occurs when you have an empty <P> tag and no space or text between the closing </P> tag and the opening <TABLE> tag.

RESOLUTION

To resolve this problem, use the nonbreaking space entity (&nbsp;) to add an extra space between the closing </P> tag and the opening <TABLE> tag. Or, you could replace the <P></P> tags with a single <P/> tag.

This issue is resolved for Internet Explorer 5.5 Service Pack 2 with an updated version of the file MSHTML.DLL. This file is included with the MS02-023: May 15, 2002, Cumulative Patch for Internet Explorer.

For additional information about this Cumulative Patch for Internet Explorer, click the article number below to view the article in the Microsoft Knowledge Base:

321232 MS02-023: May 15, 2002, Cumulative Patch for Internet

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce Behavior

Create a new HTML file called Test.htm, and paste the following code:
<HTML>
<HEAD>
<TITLE>Q274554</TITLE>
<STYLE type=text/css>
 P {PAGE-BREAK-AFTER:always}
</STYLE>
</HEAD>
<BODY>
<P></P>
<TABLE WIDTH="85%" ALIGN=center BORDER=1 CELLSPACING=1 CELLPADDING=1>
	<TR>
		<TD>11</TD>
		<TD>12</TD>
	</TR>
        .       
        .
        .
        .
        .  
	<TR>
		<TD>141</TD>
		<TD>142</TD>
	</TR>
</TABLE>
</BODY>
</HTML>
				
Make sure that the table extends beyond a single page.

Note: This bug does not reproduce if the <TABLE> tag is wrapped in <P></P> tags.

REFERENCES

For more information about developing Web-based solutions for Microsoft Internet Explorer, visit the following Microsoft Web sites:

Modification Type:MajorLast Reviewed:5/11/2006
Keywords:kbBug kbfix KB274554