﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
9037	[table] Horizontal split cell [2,1], then vertical split cell [1,2], table becomes messy	tengshengbo		"steps:
1. create a 3x3 table
2. horizontal split the first cell in the second row
3. vertical split the second cell in the first row,
**Defect:** [[BR]]
the table becomes messy.

This bug is in ""verticalSplitCell"" function. When figuring out where to insert the new cell by checking the virtual row, the index is wrong. My fix:

{{{
var currentIndex = 0;
// Figure out where to insert the new cell by checking the vitual row.
			for ( var c = 0; c < newCellRow.length; c++ )
			{
				candidateCell = newCellRow[ c ];
				// Catch first cell actually following the column.
				if ( candidateCell.parentNode == newCellTr.$
					&& currentIndex > colIndex )
				{
					var candidateCKCell =  new CKEDITOR.dom.element( candidateCell ) ;
					newCell.insertBefore(candidateCKCell);
					
					break;
				}
				else{
					if (candidateCell.colSpan>1){
						currentIndex  = currentIndex + candidateCell.colSpan;
					}else{
						currentIndex  = currentIndex + 1;
					}
					
					candidateCell = null;
				}
					
				
			}
}}}

"	Bug	closed	Normal		Core : Tables	3.6.3	duplicate		
