Index: /CKEditor/branches/prototype/_source/plugins/dialog/plugin.js
===================================================================
--- /CKEditor/branches/prototype/_source/plugins/dialog/plugin.js	(revision 2822)
+++ /CKEditor/branches/prototype/_source/plugins/dialog/plugin.js	(revision 2823)
@@ -2069,4 +2069,26 @@
 	accessKeyUp : function( dialog, key )
 	{
+	},
+
+	/**
+	 * Disables a UI element.
+	 * @example
+	 */
+	disable : function()
+	{
+		var element = this.getInputElement();
+		element.setAttribute( 'disabled', 'true' );
+		element.addClass( 'disabled' );
+	},
+
+	/**
+	 * Enables a UI element.
+	 * @example
+	 */
+	enable : function()
+	{
+		var element = this.getInputElement();
+		element.removeAttribute( 'disabled' );
+		element.removeClass( 'disabled' );
 	}
 };
Index: /CKEditor/branches/prototype/_source/plugins/dialogui/plugin.js
===================================================================
--- /CKEditor/branches/prototype/_source/plugins/dialogui/plugin.js	(revision 2822)
+++ /CKEditor/branches/prototype/_source/plugins/dialogui/plugin.js	(revision 2823)
@@ -60,5 +60,5 @@
 		reset : function()
 		{
-			this.setValue( this._['default'] );
+			this.setValue( this.getDefault() );
 		},
 
Index: /CKEditor/branches/prototype/_source/plugins/table/dialogs/table.js
===================================================================
--- /CKEditor/branches/prototype/_source/plugins/table/dialogs/table.js	(revision 2822)
+++ /CKEditor/branches/prototype/_source/plugins/table/dialogs/table.js	(revision 2823)
@@ -37,5 +37,5 @@
 				ranges = selection.getRanges(),
 				me = this,
-				selectedTable;
+				selectedTable = null;
 			if ( ranges.length > 0 )
 			{
@@ -52,5 +52,6 @@
 				},
 					widthMatch = widthPattern.exec( selectedTable.$.style.width ),
-					heightMatch = heightPattern.exec( selectedTable.$.style.height );
+					heightMatch = heightPattern.exec( selectedTable.$.style.height ),
+					caption = selectedTable.getElementsByTag( 'caption' );
 				syncAttr( 'txtBorder', 'border' );
 				syncAttr( 'cmbAlign', 'align' );
@@ -67,11 +68,38 @@
 				if ( heightMatch )
 					this.setValueOf( 'info', 'txtHeight', heightMatch[1] );
-			}
-
-			// Disable the width and height fields if a table is already selected.
-			// TODO
+
+				this.setValueOf( 'info', 'txtRows', selectedTable.$.rows.length );
+				this.setValueOf( 'info', 'txtCols', selectedTable.$.rows[0].cells.length );
+
+				if ( caption.count() > 0 )
+				{
+					caption = caption.getItem( 0 );
+					caption = ( caption.getChild( 0 ) && caption.getChild( 0 ).getText() ) || '';
+					caption = CKEDITOR.tools.trim( caption );
+					this.setValueOf( 'info', 'txtCaption', caption );
+				}
+
+				// Disable the rows and column fields if a table is already selected.
+				this.getContentElement( 'info', 'txtRows' ).disable();
+				this.getContentElement( 'info', 'txtCols' ).disable();
+
+				// Save a reference to the selected table, and push a new set of default values.
+				this._.selectedElement = selectedTable;
+				this.pushDefault();
+			}
+			else
+			{
+				this._.selectedElement = null;
+				this.getContentElement( 'info', 'txtRows' ).enable();
+				this.getContentElement( 'info', 'txtCols' ).enable();
+			}
 
 			// Put focus into the first relevant text field.
 			this.getContentElement( 'info', selectedTable ? 'txtWidth' : 'txtRows' ).select();
+		},
+		onHide : function()
+		{
+			if ( this._.selectedElement )
+				this.popDefault();
 		},
 		onOk : function()
@@ -83,6 +111,9 @@
 			// Insert the caption, if any.
 			if ( caption != '' )
-				table.append( CKEDITOR.dom.element.createFromHtml( '<caption>' 
-						+ CKEDITOR.tools.htmlEncode( caption ) + '</caption>', editor.document ) );
+			{
+				var captionElement = new CKEDITOR.dom.element( 'caption', editor.document );
+				captionElement.append( new CKEDITOR.dom.text( caption, editor.document ) );
+				table.append( captionElement );
+			}
 
 			// Generate the rows and cols.
Index: /CKEditor/branches/prototype/_source/skins/default/dialog.css
===================================================================
--- /CKEditor/branches/prototype/_source/skins/default/dialog.css	(revision 2822)
+++ /CKEditor/branches/prototype/_source/skins/default/dialog.css	(revision 2823)
@@ -701,2 +701,7 @@
 	cursor: hand ;
 }
+
+.cke_skin_default .disabled
+{
+	color: #a0a0a0;
+}
