Internet Explorer Ignores Row Boundaries When Printing a Table (269333)



The information in this article applies to:

  • Microsoft Internet Explorer 5.01 for Windows NT 4.0 SP 1

This article was previously published under Q269333

SYMPTOMS

When you print a table, Internet Explorer ignores the row boundaries. This results in a row being printed on two sheets of paper. One part is printed on one page, and the rest is printed on the next page. This behavior occurs if the HTML page has a print style specified and uses the SPAN tag.

The following sample HTML code demonstrates this behavior:
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<style id="qpsnscreen" MEDIA=SCREEN>
  .divscroll 
  {
	height:57%; 
	overflow:auto; 
	border-style:solid;
	border-width:thin; 
  }
</style>
<style id="qpsnprint" MEDIA=PRINT>
  .divscroll 
  {
    width:100%;
	height:100%; 
	overflow:visible; 
  }
</style>
</HEAD>
<BODY>
<span	id=scroll	 class=divscroll>
<table width='100%' cellpadding='0' cellspacing='0' border='1'>
		<tr>
				<td>1</td>
				<td>2</td>
				<td>3</td>
		</tr>
		<tr>
				<td>2</td>
				<td>4</td>
				<td>6</td>
		</tr>
		<tr>
				<td>3</td>
				<td>6</td>
				<td>9</td>
		</tr>
</table>
</span>
</BODY>
</HTML>
				

WORKAROUND

To work around this behavior, do not specify a print style.

The following sample HTML code is the same code as above, but with the print style commented out. This code does not cause the behavior to occur:
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<style id="qpsnscreen" MEDIA=SCREEN>
  .divscroll 
  {
	height:57%; 
	overflow:auto; 
	border-style:solid;
	border-width:thin; 
  }
</style><BR/>
<!--
<style id="qpsnprint" MEDIA=PRINT>
  .divscroll 
  {
    width:100%;
	height:100%; 
	overflow:visible; 
  }
</style><BR/>
-->
</HEAD>
<BODY>
<span	id=scroll	 class=divscroll>
<table width='100%' cellpadding='0' cellspacing='0' border='1'>
		<tr>
				<td>1</td>
				<td>2</td>
				<td>3</td>
		</tr>
		<tr>
				<td>2</td>
				<td>4</td>
				<td>6</td>
		</tr>
		<tr>
				<td>3</td>
				<td>6</td>
				<td>9</td>
		</tr>
</table>
</span>
</BODY>
</HTML>
				

Modification Type:MajorLast Reviewed:10/2/2003
Keywords:kbprb kbprint kbProgramming KB269333