XL2000: Text Spanning Multiple Cells Truncated When Saved as HTML (235087)



The information in this article applies to:

  • Microsoft Excel 2000

This article was previously published under Q235087
For a Microsoft Excel 2002 version of this article, see 291212.

SYMPTOMS

If you publish a worksheet as a Web page, and the worksheet contains text that spans multiple cells, the text does not appear properly when you open the Web page in your browser. For example, if you type the following text in cell A1

The quick brown fox jumps over the lazy dog.

and then publish the worksheet, the text in your browser appears truncated or is wrapped within cell A1.

This does not affect how the text looks when you open the file in Microsoft Excel.

CAUSE

Unlike Excel, Hypertext Markup Language (HTML) does not allow text to spill across multiple cells in a table. When you publish an HTML file that contains text that spills across multiple cells, Excel attempts to merge all of the cells in which the text spills together, so that they display correctly in the browser. However, Excel can only do this if the following conditions are true:
  • The text that spills across multiple cells is left-aligned in the source cell.

    -and-
  • The cells into which the text spills are empty.

    -and-
  • The cells into which the text spills contain formatting identical to the source cell.
If Excel is unable to merge cells together when saving the HTML file, the spilled text may not appear correctly in a browser. Some browsers interpret HTML differently, so that you may see different results depending on which browser you use to view the workbook. The following table shows how the text may appear in different browsers:
   If you have this browser          You may see this behavior
   -----------------------------------------------------------------------

   Microsoft Internet Explorer 5     Text is cropped
   Microsoft Internet Explorer 4     Text is either cropped or wrapped 
                                     to a new line.
   Netscape Navigator 4              Text may be cropped, wrapped to a 
                                     new line, or is not displayed.
   Microsoft Internet Explorer 3     Text is wrapped to a new line.
   Netscape Navigator 3              Text is wrapped to a new line. Row and 
                                     column heights and widths may not be 
                                     maintained.
				
Note that in Excel, if you open an HTML workbook containing spilled text, the spilled text is displayed correctly.

RESOLUTION

To work around this problem, use either of the following methods.

Method 1: Merge the Cells into Which the Text Spills

  1. In Excel, select all the cells into which the text spills (including the source cell for the text).
  2. On the Format menu, click Cells.
  3. Click the Alignment tab.
  4. Under Text control, click Merge cells.
  5. Click OK.

Method 2: AutoFit the Column Containing the Spilled Text

  1. In Excel, select the column containing the source cell for the text.
  2. On the Format menu, point to Column, and then click AutoFit Selection.

STATUS

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

Modification Type:MajorLast Reviewed:10/6/2003
Keywords:kbbug kbconversion kbpending KB235087