Index: /CKEditor/trunk/CHANGES.html
===================================================================
--- /CKEditor/trunk/CHANGES.html	(revision 5351)
+++ /CKEditor/trunk/CHANGES.html	(revision 5352)
@@ -126,4 +126,5 @@
 		<li><a href="http://dev.fckeditor.net/ticket/5465">#5465</a> : ShiftEnter=DIV doesn't respect list item when pressing enter at end of list item.</li>
 		<li><a href="http://dev.fckeditor.net/ticket/5454">#5454</a> : After replaced success, the popup window couldn't been closed and a js error occured.</li>
+		<li><a href="http://dev.fckeditor.net/ticket/4784">#4784</a> :Incorrect cursor position after delete table cells.</li>
 		<li>Updated the following language files:<ul>
 			<li>Faroese;</li>
Index: /CKEditor/trunk/_source/plugins/tabletools/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/tabletools/plugin.js	(revision 5351)
+++ /CKEditor/trunk/_source/plugins/tabletools/plugin.js	(revision 5352)
@@ -85,4 +85,41 @@
 
 		return retval;
+	}
+	
+	function getFocusedCell( cellsToDelete ) {
+		var i = 0,
+			last = cellsToDelete.length - 1,
+			database = {},
+			cell,focusedCell,
+			tr;
+	
+		while ( cell = cellsToDelete[ i++ ] )
+			CKEDITOR.dom.element.setMarker( database, cell, 'delete_cell', true );
+		
+		// 1.first we check left or right side focusable cell row by row;
+		i = 0;
+		while ( cell = cellsToDelete[ i++ ] )
+		{
+			if ( ( focusedCell = cell.getPrevious() ) && !focusedCell.getCustomData( 'delete_cell' )			  
+			  || ( focusedCell = cell.getNext()     ) && !focusedCell.getCustomData( 'delete_cell' ) )
+			{
+				CKEDITOR.dom.element.clearAllMarkers( database );
+				return focusedCell;
+			}
+		}
+
+		CKEDITOR.dom.element.clearAllMarkers( database );
+
+		// 2. then we check the toppest row (outside the selection area square) focusable cell
+		tr = cellsToDelete[ 0 ].getParent();
+		if ( tr = tr.getPrevious() )
+			return tr.getLast();
+		
+		// 3. last we check the lowerest  row focusable cell
+		tr = cellsToDelete[ last ].getParent();
+		if ( tr = tr.getNext() )
+			return tr.getChild( 0 );
+
+		return null;
 	}
 
@@ -278,11 +315,20 @@
 		{
 			var cellsToDelete = getSelectedCells( selectionOrCell );
+			var table = cellsToDelete[ 0 ] && cellsToDelete[ 0 ].getAscendant( 'table' );
+			var cellToFocus   = getFocusedCell( cellsToDelete );
+
 			for ( var i = cellsToDelete.length - 1 ; i >= 0 ; i-- )
 				deleteCells( cellsToDelete[ i ] );
+			
+			if ( cellToFocus )
+				placeCursorInCell( cellToFocus, true );
+			else if ( table )
+				table.remove();
 		}
 		else if ( selectionOrCell instanceof CKEDITOR.dom.element )
 		{
-			if ( selectionOrCell.getParent().getChildCount() == 1 )
-				selectionOrCell.getParent().remove();
+			var tr = selectionOrCell.getParent();
+			if ( tr.getChildCount() == 1 )
+				tr.remove();
 			else
 				selectionOrCell.remove();
