Index: /CKEditor/trunk/CHANGES.html
===================================================================
--- /CKEditor/trunk/CHANGES.html	(revision 5735)
+++ /CKEditor/trunk/CHANGES.html	(revision 5736)
@@ -85,4 +85,5 @@
 		<li><a href="http://dev.fckeditor.net/ticket/5558">#5558</a> : After pasting on WebKit based browsers the editor now scrolls to the end of the pasted content.</li>
 		<li><a href="http://dev.fckeditor.net/ticket/5799">#5799</a> : Correct plugin dependencies for the liststyle plugin with contextMenu and dialog.</li>
+		<li><a href="http://dev.fckeditor.net/ticket/5436">#5436</a> : IE: The cursor was moving to the wrong position when inserting inline elements at the end of cells on tables.</li>
 		<li>Updated the following language files:<ul>
 			<li><a href="http://dev.fckeditor.net/ticket/5962">#5962</a> : German;</li>
Index: /CKEditor/trunk/_source/plugins/wysiwygarea/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/wysiwygarea/plugin.js	(revision 5735)
+++ /CKEditor/trunk/_source/plugins/wysiwygarea/plugin.js	(revision 5736)
@@ -16,4 +16,6 @@
 	// Matching an empty paragraph at the end of document.
 	var emptyParagraphRegexp = /\s*<(p|div|address|h\d|center|li)[^>]*>\s*(?:<br[^>]*>|&nbsp;|\u00A0|&#160;)?\s*(:?<\/\1>)?\s*(?=$|<\/body>)/gi;
+
+	var notWhitespaceEval = CKEDITOR.dom.walker.whitespaces( true );
 
 	function onInsertHtml( evt )
@@ -131,8 +133,15 @@
 			range.moveToPosition( lastElement, CKEDITOR.POSITION_AFTER_END );
 
-			var next = lastElement.getNextSourceNode( true );
-			var lastElementIsInline = CKEDITOR.dtd.$inline[ lastElement.getName() ];
-			if ( !lastElementIsInline && next && next.type == CKEDITOR.NODE_ELEMENT )
-				range.moveToElementEditStart( next );
+			// If we're inserting a block element immediatelly followed by
+			// another block element, the selection must move there. (#3100,#5436)
+			if ( isBlock )
+			{
+				var next = lastElement.getNext( notWhitespaceEval ),
+					nextName = next && next.type == CKEDITOR.NODE_ELEMENT && next.getName();
+
+				// Check if it's a block element that accepts text.
+				if ( nextName && CKEDITOR.dtd.$block[ nextName ] && CKEDITOR.dtd[ nextName ]['#'] )
+					range.moveToElementEditStart( next );
+			}
 
 			selection.selectRanges( [ range ] );
