Infinite pagination of pages when printing tables using IE7


Hi everyone!

This is Shahinur from the IE Support team.  I’ve supported IE for some time now, and have seen the following printing issue come up quite a few times in IE7, so I thought I would write a few lines to better explain the issue.

 

When you have a page with with nested tables, a layout similar to the following example, it will take up 100% CPU when attempting to print it.  It will also never successfully print.  If you select print preview, you will see that IE continuously lays out page after page:

This is a printing hang when the page break  involves table cells. Print preview will hang when we keep trying to fit content in a page, but the content is too big for any page. The good news is that the IE team has released a hotfix to resolve the problem.

NOTE:  The hotfix discussed above is KB933264.  You will need to contact Microsoft Support to obtain this hotfix.

 

<html>
  <head>
  </head>
  <body>
    <table width=”100%” height=”100%” cellpadding=”0″ cellspacing=”0″ border=”0″>
      <tr id=”trMap” height=”60%”>
        <td id=”tdMapTarget” valign=”top” align=”center”>
        </td>
      </tr>
      <tr valign=”top” height=”38%”>
        <td>
          <span id=”spanContent” style=’width: 100%; height: 100%; padding: 10px’>
            <table width=”100%” height=”100%” cellpadding=”0″ cellspacing=”0″ border=”0″>
              <tr valign=”top”>
                <td id=”tdDisplayOptions” valign=”top” class=”Text_Small” style=’border-top: solid #7AA3D5 2px’>
                  <b>Display Options: </b>
                  <input type=”radio” value=”text” name=”DisplayMode” onclick=”ChangeDisplayMode(0)”></input>Text
                  only
                  <input type=”radio” value=”overview” name=”DisplayMode” onclick=”ChangeDisplayMode(1)”></input>Overview
                  Map with Text
                </td>
              </tr>
              <tr valign=”top”>
                <td id=”tdMapDirectionsSummary” valign=”top” style=’border-top: solid #7AA3D5 2px’>
                </td>
              </tr>
              <tr valign=”top”>
                <td id=”tdMapDirections” valign=”top” style=’border-top: solid #7AA3D5 2px’>
                  <table class=”Text_Small” cellspacing=”0″ cellpadding=”0″ width=”100%” border=”0″>
                    <tbody>
                      <tr style=’color: white; background-color: #36659c’ width=’100%’>
                        <td colspan=”2″>
                          DIRECTIONS</td>
                        <td align=”right”>
                          DISTANCE</td>
                      </tr>
                      <tr id=”trTrekImage1″ style=’display: none’>
                        <td align=”middle” colspan=”3″>
                          <div id=”tdTrekImage1″ style=’overflow: hidden; width: 470px; height: 320px’>
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px; border-top: #7aa3d5 2px solid’>
                          <b>From:</b></td>
                        <td id=”tdAddrFrom1″ style=’padding-right: 5px; border-top: #7aa3d5 2px solid’ colspan=’2′>
                        </td>
                        <tr>
                          <td style=’border-bottom: black 1px solid’>
                            <b>To:</b></td>
                          <td id=”tdAddrTo1″ style=’border-bottom: black 1px solid’ colspan=’2′>
                          </td>
                          <tr>
                            <td style=’padding-right: 5px’ align=’right’>
                              <b>1:</b></td>
                            <td>
                              Start out going EAST on GOLDHILL AVE toward COMSTOCK DR.</td>
                            <td align=”right”>
                              0.16 mi</td>
                          </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>2:</b></td>
                        <td>
                          Turn RIGHT onto COMSTOCK DR.</td>
                        <td align=”right”>
                          0.47 mi</td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>3:</b></td>
                        <td>
                          Turn RIGHT onto W WASHINGTON AVE.</td>
                        <td align=”right”>
                          0.09 mi</td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>4:</b></td>
                        <td>
                          Turn LEFT onto CLARKWAY DR.</td>
                        <td align=”right”>
                          0.26 mi</td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>5:</b></td>
                        <td>
                          Turn RIGHT onto W BONANZA RD/NV-579. Continue to follow W BONANZA RD.</td>
                        <td align=”right”>
                          0.49 mi</td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>6:</b></td>
                        <td>
                          Turn SHARP LEFT onto N RANCHO DR/NV-599 S/US-95 BR S/TONOPAH HWY.</td>
                        <td align=”right”>
                          0.10 mi</td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>7:</b></td>
                        <td>
                          Merge onto US-95 N.</td>
                        <td align=”right”>
                          9.56 mi</td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>8:</b></td>
                        <td>
                          Take the ANN ROAD exit, EXIT 90B.</td>
                        <td align=”right”>
                          0.43 mi</td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>9:</b></td>
                        <td>
                          Keep RIGHT at the fork to go on W ANN RD.</td>
                        <td align=”right”>
                          0.13 mi</td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>10:</b></td>
                        <td>
                          Turn LEFT onto N TENAYA WAY.</td>
                        <td align=”right”>
                          0.13 mi</td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>11:</b></td>
                        <td>
                          Stay STRAIGHT to go onto SKY POINTE DR.</td>
                        <td align=”right”>
                          0.67 mi</td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>12:</b></td>
                        <td>
                          Turn RIGHT onto RANCH HOUSE RD.</td>
                        <td align=”right”>
                          0.13 mi</td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>13:</b></td>
                        <td>
                          Turn LEFT onto VIOLET VISTA AVE.</td>
                        <td align=”right”>
                          0.07 mi</td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>14:</b></td>
                        <td>
                          Turn RIGHT onto DAISY PETAL ST.</td>
                        <td align=”right”>
                          0.05 mi</td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>15:</b></td>
                        <td>
                          Turn RIGHT onto GLOWING EMBER CT.</td>
                        <td align=”right”>
                          0.02 mi</td>
                      </tr>
                      <tr>
                        <td colspan=”2″>
                        </td>
                        <td align=”right”>
                          <b>SUBTOTAL DISTANCE</b><br>
                          12.75 mi</td>
                      </tr>
                      <tr id=”trTrekImage2″ style=’display: none’>
                        <td align=”middle” colspan=”3″>
                          <div id=”tdTrekImage2″ style=’overflow: hidden; width: 470px; height: 320px’>
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px; border-top: #7aa3d5 2px solid’>
                          <b>From:</b></td>
                        <td id=”tdAddrFrom2″ style=’padding-right: 5px; border-top: #7aa3d5 2px solid’ colspan=’2′>
                        </td>
                        <tr>
                          <td style=’border-bottom: black 1px solid’>
                            <b>To:</b></td>
                          <td id=”tdAddrTo2″ style=’border-bottom: black 1px solid’ colspan=’2′>
                          </td>
                          <tr>
                            <td style=’padding-right: 5px’ align=’right’>
                              <b>16:</b></td>
                            <td>
                              Start out going WEST on GLOWING EMBER CT toward DAISY PETAL ST.</td>
                            <td align=”right”>
                              0.02 mi</td>
                          </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>17:</b></td>
                        <td>
                          Turn RIGHT onto DAISY PETAL ST.</td>
                        <td align=”right”>
                          0.05 mi</td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>18:</b></td>
                        <td>
                          Turn RIGHT onto DURHAM HALL AVE.</td>
                        <td align=”right”>
                          0.07 mi</td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>19:</b></td>
                        <td>
                          Turn LEFT onto RANCH HOUSE RD.</td>
                        <td align=”right”>
                          0.07 mi</td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>20:</b></td>
                        <td>
                          Turn RIGHT onto AZURE RD.</td>
                        <td align=”right”>
                          0.44 mi</td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>21:</b></td>
                        <td>
                          Turn LEFT onto N TENAYA WAY.</td>
                        <td align=”right”>
                          0.23 mi</td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>22:</b></td>
                        <td>
                          Turn LEFT onto CENTENNIAL PKWY.</td>
                        <td align=”right”>
                          0.62 mi</td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>23:</b></td>
                        <td>
                          Turn LEFT onto W FRONTAGE RD.</td>
                        <td align=”right”>
                          0.09 mi</td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>24:</b></td>
                        <td>
                          Turn LEFT onto CR-215.</td>
                        <td align=”right”>
                          5.02 mi</td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>25:</b></td>
                        <td>
                          Turn RIGHT onto SIMMONS ST.</td>
                        <td align=”right”>
                          0.38 mi</td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>26:</b></td>
                        <td>
                          Turn RIGHT onto W DEER SPRINGS WAY.</td>
                        <td align=”right”>
                          0.50 mi</td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>27:</b></td>
                        <td>
                          Turn RIGHT onto PLUM POET PL.</td>
                        <td align=”right”>
                          0.03 mi</td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>28:</b></td>
                        <td>
                          Turn LEFT onto LAVENDER LILLY LN.</td>
                        <td align=”right”>
                          0.08 mi</td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>29:</b></td>
                        <td>
                          Turn RIGHT onto HAZELNUT PINE PL.</td>
                        <td align=”right”>
                          0.00 mi</td>
                      </tr>
                      <tr>
                        <td colspan=”2″>
                        </td>
                        <td align=”right”>
                          <b>SUBTOTAL DISTANCE</b><br>
                          7.59 mi</td>
                      </tr>
                      <tr id=”trTrekImage3″ style=’display: none’>
                        <td align=”middle” colspan=”3″>
                          <div id=”tdTrekImage3″ style=’overflow: hidden; width: 470px; height: 320px’>
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px; border-top: #7aa3d5 2px solid’>
                          <b>From:</b></td>
                        <td id=”tdAddrFrom3″ style=’padding-right: 5px; border-top: #7aa3d5 2px solid’ colspan=’2′>
                        </td>
                        <tr>
                          <td style=’border-bottom: black 1px solid’>
                            <b>To:</b></td>
                          <td id=”tdAddrTo3″ style=’border-bottom: black 1px solid’ colspan=’2′>
                          </td>
                          <tr>
                            <td style=’padding-right: 5px’ align=’right’>
                              <b>30:</b></td>
                            <td>
                              Start out going SOUTHEAST on HAZELNUT PINE PL toward LAVENDER LILLY LN.</td>
                            <td align=”right”>
                              0.00 mi</td>
                          </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>31:</b></td>
                        <td>
                          Turn RIGHT onto LAVENDER LILLY LN.</td>
                        <td align=”right”>
                          0.06 mi</td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>32:</b></td>
                        <td>
                          Turn LEFT onto SAPWOOD PL.</td>
                        <td align=”right”>
                          0.03 mi</td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>33:</b></td>
                        <td>
                          Turn RIGHT onto W DEER SPRINGS WAY.</td>
                        <td align=”right”>
                          0.11 mi</td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>34:</b></td>
                        <td>
                          Turn LEFT onto ALLEN LN.</td>
                        <td align=”right”>
                          1.27 mi</td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>35:</b></td>
                        <td>
                          Turn LEFT onto W ANN RD.</td>
                        <td align=”right”>
                          1.82 mi
            </td>
                     </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>36:</b></td>
                        <td>
                          Turn RIGHT onto CAMINO AL NORTE.</td>
                        <td align=”right”>
                          1.80 mi</td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>37:</b></td>
                        <td>
                          Stay STRAIGHT to go onto N MARTIN L KING BLVD.</td>
                        <td align=”right”>
                          1.50 mi</td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>38:</b></td>
                        <td>
                          Turn LEFT onto W CHEYENNE AVE/NV-574.</td>
                        <td align=”right”>
                          2.25 mi</td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>39:</b></td>
                        <td>
                          Turn RIGHT onto CIVIC CENTER DR/NV-607 S.</td>
                        <td align=”right”>
                          0.51 mi</td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>40:</b></td>
                        <td>
                          Turn LEFT onto E EVANS AVE.</td>
                        <td align=”right”>
                          0.29 mi</td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>41:</b></td>
                        <td>
                          Turn RIGHT onto CARROLL ST.</td>
                        <td align=”right”>
                          0.08 mi</td>
                      </tr>
                      <tr>
                        <td colspan=”2″>
                        </td>
                        <td align=”right”>
                          <b>SUBTOTAL DISTANCE</b><br>
                          9.72 mi</td>
                      </tr>
                      <tr id=”trTrekImage4″ style=’display: none’>
                        <td align=”middle” colspan=”3″>
                          <div id=”tdTrekImage4″ style=’overflow: hidden; width: 470px; height: 320px’>
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px; border-top: #7aa3d5 2px solid’>
                          <b>From:</b></td>
                        <td id=”tdAddrFrom4″ style=’padding-right: 5px; border-top: #7aa3d5 2px solid’ colspan=’2′>
                        </td>
                        <tr>
                          <td style=’border-bottom: black 1px solid’>
                            <b>To:</b></td>
                          <td id=”tdAddrTo4″ style=’border-bottom: black 1px solid’ colspan=’2′>
                          </td>
                          <tr>
                            <td style=’padding-right: 5px’ align=’right’>
                              <b>42:</b></td>
                            <td>
                              Start out going SOUTH on CARROLL ST toward FERGUSON AVE.</td>
                            <td align=”right”>
                              0.31 mi</td>
                          </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>43:</b></td>
                        <td>
                          Turn RIGHT onto N LAS VEGAS BLVD/NV-604 S.</td>
                        <td align=”right”>
                          0.33 mi</td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>44:</b></td>
                        <td>
                          Turn LEFT onto NV-607 S/CIVIC CENTER DR. Continue to follow NV-607 S.</td>
                        <td align=”right”>
                          1.90 mi</td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>45:</b></td>
                        <td>
                          Turn RIGHT onto E WILSON AVE.</td>
                        <td align=”right”>
                          0.10 mi</td>
                      </tr>
                      <tr>
                        <td style=’padding-right: 5px’ align=’right’>
                          <b>46:</b></td>
                        <td>
                          Turn RIGHT onto FLOWER ST.</td>
                        <td align=”right”>
                          0.00 mi</td>
                      </tr>
                      <tr>
                        <td colspan=”2″>
                        </td>
                        <td align=”right”>
                          <b>SUBTOTAL DISTANCE</b><br>
                          2.66 mi</td>
                      </tr>
                      <tr>
                        <td style=’border-top: black 1px solid’ colspan=’2′>
                          <b>TOTAL ESTIMATED TIME:</b><br>
                          58 minutes</td>
                        <td style=’border-top: black 1px solid’ align=’right’>
                          <b>TOTAL DISTANCE:</b><br>
                          32.72 mi</td>
                      </tr>
                    </tbody>
                  </table>
                </td>
              </tr>
            </table>
          </span>
        </td>
      </tr>
      <tr height=”1%”>
        <td colspan=”2″ style=’font-size: 7pt; color: #808080′>
          These maps/directions are informational only. No representation is made or warranty
          given as to their content, road conditions or route usability or expeditiousness.
          User assumes all risk of use. MapQuest, First American MLS Solutions and their suppliers
          assume no responsibility for any loss or delay resulting from such use. <a href=”http://www.mapquest.com/features/main.adp?page=legal”>
            End-User Terms</a>
        </td>
      </tr>
    </table>
  </body>
</html>

 

Even so, it seems like there are some corner cases that were missed.  For example, a page with nested tables with a height of 100% and column spanning, you will see a similar printing problem even with the hotfix above installed.

<html>
<body>
<table style=’height: 100%; background: beige’>
<tbody>
<tr>
<td colspan=”2″>
<span style=’height: 100%; background: pink’>
<table style=’height: 100%; background: lightGreen;’>
<tbody>
<tr>
<td>
</td>
</tr>
</tbody>
</table>
<div style=’width: 100px; background: red;’>
</div>
</span>
</td>
</tr>
</tbody>
</table>
</body>
</html>

 

There is an easy workaround to this and that is to remove at least one of the 100% height instances.

I hope you found this information useful and informative!

 

Regards,

The IE Support team

Comments (2)

  1. I’m investigating an issue that we’re having with our product, similar problem (cpu on the ie process goes to 100%, and never stops when printing some pages)

    one thing I noticed on the testbed when working this is that there are currently no fewer than 2 copies of the mshtml.dll file on the system.  a majority are in update directories and such, but one thing that concerns me is a really old (version 6!!) version of the dll in the actual IE7 (cwindowsie7) directory itself.

    Could IE7 potentially be using this old version of the dll, instead of the newer one that is located in the system32 directory?

    for what it’s worth we’ve reproduced the problem on a variety of platforms including XP and Server 2003..  and changing the print margins (from the defaults of ..75 to .5)  before printing appears to correct the issue.

  2. Ok guys this is really really really @#$%^ frustrating.  went to go get the hotfix you mention above.  did this from a server2003 system were I reproduced the error.  The hotfix specifically lists two ‘things in the ‘applies to’ section, which is IE7  and IE7 on XP..  well I’ve got IE7 on Svr2k3, which is pretty close to xp in the UI-shell level   so I try to go get the hotfix.

    I am given ONE single choice for the platform for the hotfix which is Windows VISTA (not what I’m using).. but hey I need to test the fix and see if it solves the issue.. so I submit my info and have them mail it to me..  The resulting file is a .MSU file..  which I could use on server 2008 or vista by running the WUSA program (windows update stand alone installer)..  BUT hey folks, the platforms affected by this issue (XP, or in my case server2003) don’t have WUSA anywhere on the box..

    so ah  hey  how in the world am I supposed to make use of this hotfix file I got sent?

    this is the type of crap that makes people hate MS..   jump through a bunch of hoops to get something that is supposed to fix a problem only to have the fix locked into a virtual box for which you don’t have a key..

    effing brilliant..   you couldn’t do more to push people away from MS if you tried.

    The company I work for has been an MS gold level partner for well over 5 years..  and you know what we’re going to have to tell people affected by this bug to do in order to fix it?   we’re going to have to tell them to use firefox..  because even if this hotfix DID solve their problem there’s no way for them to get it from you and install it.

    just effing brilliant..   great work folks.

Skip to main content