Microsoft KB Archive/832982

= BUG: The DHTML Editing Component does not not split cells correctly =

PSS ID Number: 832982

Article Last Modified on 3/23/2004

-

The information in this article applies to:


 * Microsoft Internet Explorer (Programming) version 6.0

-





SYMPTOMS
When you use the Microsoft Dynamic HTML (DHTML) Editing Component in Microsoft Internet Explorer to split the cells of a table, you may receive different results depending on how the cells are split. The column span for the cells might appear different if you split the cells in different columns, especially in the cells that are newly created.

When you split a cell of a table by using the DECMD_SPLITCELL command ID of the ExecCommand method from the DHTML Editing Component, depending on where you split the cells, the widths of the cells (or of the column span) in other rows might not change to the right row span. The expected result might be that the column span for the cells in the same row (other than the cell that you split) should increase. But if you split a cell that is the only cell of the column, the column span of the other cells in different rows will change awkwardly.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the &quot;Applies to&quot; section of this article.



Steps to reproduce the behavior
  Insert the following code in a text editor, and then save it as Test.htm:   function button1_onclick { var selArea = ActiveXEditor.DOM.selection.createRange; var t = &quot;&quot;; t += ' '; selArea.pasteHTML( t ); }

function button2_onclick { ActiveXEditor.ExecCommand(5047, false); }         <PARAM NAME=&quot;ShowBorders&quot; VALUE=&quot;0&quot;> <PARAM NAME=&quot;Appearance&quot; VALUE=&quot;1&quot;> <PARAM NAME=&quot;Scrollbars&quot; VALUE=&quot;-1&quot;> <PARAM NAME=&quot;ScrollbarAppearance&quot; VALUE=&quot;1&quot;> <PARAM NAME=&quot;SourceCodePreservation&quot; VALUE=&quot;-1&quot;> <PARAM NAME=&quot;AbsoluteDropMode&quot; VALUE=&quot;0&quot;> <PARAM NAME=&quot;SnapToGrid&quot; VALUE=&quot;0&quot;> <PARAM NAME=&quot;SnapToGridX&quot; VALUE=&quot;50&quot;> <PARAM NAME=&quot;SnapToGridY&quot; VALUE=&quot;50&quot;> <PARAM NAME=&quot;UseDivOnCarriageReturn&quot; VALUE=&quot;0&quot;> </OBJECT> <INPUT type=button value=&quot;Insert table&quot; id=button1 name=button1 LANGUAGE=javascript onclick=&quot;return button1_onclick&quot;> <INPUT id=button2 type=button value=&quot;Split cell&quot; name=button2 LANGUAGE=javascript onclick=&quot;return button2_onclick&quot;> <P> <B>Test 1:</B><BR> 1. Click &quot;Insert table&quot; to insert a table.<BR> 2. Position the cursor in the first cell (contains &quot;a&quot;).<BR> 3. Click &quot;Split cell&quot;.<BR> 4. Position the cursor in the first cell again.<BR> 5. Click &quot;Split cell&quot;.<BR> RESULT: The cell that contains &quot;c&quot; now spans three columns. This is the expected behavior.</P> <P> <B>Test 2:</B><BR> 1. Position the cursor below the table.<BR> 2. Click &quot;Insert table&quot; to insert a table.<BR> 3. Position the cursor in the first cell (contains &quot;a&quot;).<BR> 4. Click &quot;Split cell&quot;.<BR> 5. Position the cursor in the second cell (the newly created empty one).<BR> 6. Click &quot;Split cell&quot;.<BR> RESULT: The resulting table should look the same as the first table, but does not. The cell that contains &quot;c&quot; now only spans two columns.</P> </BODY> </li> <li>Open the Test.htm page in Internet Explorer, and then follow the steps on the Web page to reproduce the problem.</li></ol>

The cells that contain b and d should remain in the same column. Because the cell that you are splitting is in the column that contains c, you expect the new cell after the split to remain in that column and not move above the d. That behavior shifts the cell that contains b to a new column.

Keywords: kbpending kbtable kbhtml kbbug KB832982

Technology:

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© 2004 Microsoft Corporation. All rights reserved.