Index: /trunk/plugins/TableOperations/TableOperations.js
===================================================================
--- /trunk/plugins/TableOperations/TableOperations.js (revision 1067)
+++ /trunk/plugins/TableOperations/TableOperations.js (revision 1075)
@@ -503,5 +503,5 @@
   var dialog = this.dialogTable;
   
-  var Styler = new Xinha.InlineStyler(table, this.editor);
+  var Styler = new Xinha.InlineStyler(table, this.editor, dialog);
   
   function apply() {
@@ -512,5 +512,6 @@
       if(typeof params[i] == 'function') continue;
       var val = params[i];
-      if (typeof val == 'object' && val.tagName) val = val.value;
+      //if (val == null) continue;
+      if (typeof val == 'object' && val != null && val.tagName) val = val.value;
       switch (i) {
       case "caption":
@@ -619,9 +620,9 @@
   var dialog = this.dialogRowCell;
   dialog.getElementById('title').innerHTML = cell ? Xinha._lc("Cell Properties", "TableOperations") : Xinha._lc("Row Properties", "TableOperations");
-  var Styler = new Xinha.InlineStyler(element, self.editor);
+  var Styler = new Xinha.InlineStyler(element, self.editor, dialog);
   
   function apply() {
     var params = dialog.hide();
-    Styler.applyStyle();
+    Styler.applyStyle(params);
     
     // various workarounds to refresh the table display (Gecko,
Index: /trunk/modules/InlineStyler/InlineStyler.js
===================================================================
--- /trunk/modules/InlineStyler/InlineStyler.js (revision 1065)
+++ /trunk/modules/InlineStyler/InlineStyler.js (revision 1075)
@@ -1,6 +1,7 @@
-Xinha.InlineStyler = function(element, editor, doc)
+Xinha.InlineStyler = function(element, editor, dialog, doc)
 {
   this.element = element;
   this.editor = editor;
+  this.dialog = dialog;
   this.doc = doc ? doc : document;
   this.inputs = {
@@ -32,5 +33,7 @@
     if (typeof params[i] == 'function') 
       continue;
-    var val = params[i].value;
+    if (params[i] != null)
+      var val = params[i].value || params[i];
+
     switch (i)
     {
@@ -46,5 +49,5 @@
       break;
     case "borderCollapse":
-      style.borderCollapse =  params[i].checked ? "collapse" : "";
+      style.borderCollapse = params[i] == "on" ? "collapse" : "separate";
       break;
     case "width":
@@ -109,8 +112,7 @@
       break;
     case "borderWidth":
-      var borderWidthUnit = this.inputs.aux["heightUnit"].value;
-      style[i] = val + (borderWidthUnit) ? borderWidthUnit : 'px';
-      break;
-    default:
+      style[i] = val + "px";
+      break;
+    default:      
       style[i] = val;
       break;
@@ -155,4 +157,5 @@
     tr.appendChild(td);
     select = doc.createElement("select");
+    select.name = this.dialog.createId("float");
     td.appendChild(select);
     this.inputs.styles['float'] = select;
@@ -185,4 +188,5 @@
   tr.appendChild(td);
   input = doc.createElement("input");
+  input.name = this.dialog.createId("width");
   input.type = "text";
   input.value = Xinha.InlineStyler.getLength(el.style.width);
@@ -192,4 +196,5 @@
   td.appendChild(input);
   select = doc.createElement("select");
+  select.name = this.dialog.createId("widthUnit");
   this.inputs.aux['widthUnit'] = select;
   option = doc.createElement("option");
@@ -208,4 +213,5 @@
   td.appendChild(doc.createTextNode(Xinha._lc("Text align", "TableOperations") + ":"));
   select = doc.createElement("select");
+  select.name = this.dialog.createId("textAlign");
   select.style.marginLeft = select.style.marginRight = "0.5em";
   td.appendChild(select);
@@ -218,5 +224,5 @@
   input = doc.createElement("input");
   this.inputs.aux['textAlignChar'] = input;
-  input.name= 'fuck';
+  input.name= this.dialog.createId("textAlignChar");
   input.size = "1";
   input.style.fontFamily = "monospace";
@@ -258,4 +264,5 @@
   tr.appendChild(td);
   input = doc.createElement("input");
+  input.name = this.dialog.createId("height");
   input.type = "text";
   input.value = Xinha.InlineStyler.getLength(el.style.height);
@@ -265,4 +272,5 @@
   td.appendChild(input);
   select = doc.createElement("select");
+  select.name = this.dialog.createId("heightUnit");
   this.inputs.aux['heightUnit'] = select;
   option = doc.createElement("option");
@@ -281,4 +289,5 @@
   td.appendChild(doc.createTextNode(Xinha._lc("Vertical align", "TableOperations") + ":"));
   select = doc.createElement("select");
+  select.name = this.dialog.createId("verticalAlign");
   this.inputs.styles['verticalAlign'] = select;
   select.style.marginLeft = "0.5em";
@@ -330,4 +339,5 @@
 
   input = doc.createElement("input");
+  input.name = this.dialog.createId("backgroundColor");
   input.value = Xinha._colorToRgb( el.style.backgroundColor );
   input.type = "hidden";
@@ -337,12 +347,11 @@
   new Xinha.colorPicker.InputBinding(input)
   
-  td.appendChild(doc.createTextNode(Xinha._lc("Image URL", "TableOperations") + ": "));
-  input = doc.createElement("input");
+  td.appendChild(doc.createTextNode(" " + Xinha._lc("Image URL", "TableOperations") + ": "));
+  input = doc.createElement("input");
+  input.name = this.dialog.createId("backgroundImage");
   input.type = "text";
   this.inputs.styles['backgroundImage'] = input;
-  if (el.style.backgroundImage.match(/url\(\s*(.*?)\s*\)/)) 
-  {
+  if (el.style.backgroundImage.match(/url\(\s*(.*?)\s*\)/))
     input.value = RegExp.$1;
-  }
   // input.style.width = "100%";
   td.appendChild(input);
@@ -357,4 +366,5 @@
   tr.appendChild(td);
   input = doc.createElement("input");
+  input.name = this.dialog.createId("color");
   input.value = Xinha._colorToRgb( el.style.color );
   input.type = "hidden";
@@ -379,4 +389,5 @@
   tr.appendChild(td);
   input = doc.createElement("input");
+  input.name = this.dialog.createId("borderColor");
   input.value = Xinha._colorToRgb( el.style.borderColor );
   input.type = "hidden";
@@ -387,4 +398,5 @@
   
   select = doc.createElement("select");
+  select.name = this.dialog.createId("borderStyle");
   var borderFields = [];
   td.appendChild(select);
@@ -424,4 +436,5 @@
   
   input = doc.createElement("input");
+  input.name = this.dialog.createId("borderWidth");
   borderFields.push(input);
   input.type = "text";
@@ -447,4 +460,5 @@
     tr.appendChild(td);
     input = doc.createElement("input");
+    input.name = this.dialog.createId("borderCollapse");
     input.type = "checkbox";
     this.inputs.styles['borderCollapse'] = input;
Index: /trunk/modules/Dialogs/XinhaDialog.js
===================================================================
--- /trunk/modules/Dialogs/XinhaDialog.js (revision 1058)
+++ /trunk/modules/Dialogs/XinhaDialog.js (revision 1075)
@@ -1038,10 +1038,5 @@
     function(fullString, id)
     {
-      if(typeof dialog.id[id] == 'undefined')
-      {
-        dialog.id[id] = Xinha.uniq('Dialog');
-        dialog.r_id[dialog.id[id]] = id;
-      }
-      return dialog.id[id];
+      return dialog.createId(id);
     }
     ).replace(/<l10n>(.*?)<\/l10n>/ig,
@@ -1058,4 +1053,27 @@
   return html;
 }
+
+/** Use this function when adding an element with a new ID/name to a 
+ *  dialog after it has already been created. This function ensures
+ *  that the dialog has the id/name stored in its reverse-lookup table
+ *  (which is required for form values to be properly returned by
+ *  Xinha.Dialog.hide).
+ * 
+ * @param {id} the id (or name) to add 
+ *
+ * Returns the internal ID to which the passed in ID maps
+ *
+ * TODO: createId is a really awful name, but I can't think of anything better...
+ */
+Xinha.Dialog.prototype.createId = function(id)
+{
+  var dialog = this;
+  if (typeof dialog.id[id] == 'undefined')
+  {
+    dialog.id[id] = Xinha.uniq('Dialog');
+    dialog.r_id[dialog.id[id]] = id;
+  }
+  return dialog.id[id];
+};
 
 /** When several modeless dialogs are shown, one can be brought to front with this function (as happens on mouseclick) 
