Adding support for setting column widths in CellTable, and for allowing CellTable to use fixed table-layout for more precise control over column widths. I also updated the CellTable example in Showcase and the DynaTableRf sample with the new feature so that columns do not resize when paging.
https://groups.google.com/group/google-web-toolkit-contributors/browse_thread/thread/46bd604e11091025/f8eb6326b0892417?lnk=raot#f8eb6326b0892417

Review at http://gwt-code-reviews.appspot.com/1263801

Review by: sbrubaker@google.com

git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@9513 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/SummaryWidget.java b/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/SummaryWidget.java
index 213fd21..4024b61 100644
--- a/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/SummaryWidget.java
+++ b/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/SummaryWidget.java
@@ -62,7 +62,6 @@
   }
 
   interface Style extends CssResource {
-    String thirty();
   }
 
   interface TableResources extends CellTable.Resources {
@@ -106,9 +105,6 @@
   @UiField
   DockLayoutPanel dock;
 
-  @UiField
-  Style style;
-
   @UiField(provided = true)
   SimplePager pager = new SimplePager();
 
@@ -135,11 +131,13 @@
     dock.getWidgetContainerElement(table).getStyle().setProperty("overflowY",
         "visible");
 
-    table.addColumn(new NameColumn(), "Name");
-    table.addColumn(new DescriptionColumn(), "Description");
+    Column<PersonProxy, String> nameColumn = new NameColumn();
+    table.addColumn(nameColumn, "Name");
+    table.setColumnWidth(nameColumn, "25ex");
+    Column<PersonProxy, String> descriptionColumn = new DescriptionColumn();
+    table.addColumn(descriptionColumn, "Description");
+    table.setColumnWidth(descriptionColumn, "40ex");
     table.addColumn(new ScheduleColumn(), "Schedule");
-    table.addColumnStyleName(0, style.thirty());
-    table.addColumnStyleName(1, style.thirty());
     table.setRowCount(numRows, false);
     table.setSelectionModel(selectionModel);
     table.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED);
diff --git a/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/SummaryWidget.ui.xml b/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/SummaryWidget.ui.xml
index 77398a0..1017417 100644
--- a/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/SummaryWidget.ui.xml
+++ b/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/SummaryWidget.ui.xml
@@ -6,12 +6,9 @@
       	display: inline;
       }
       
-      .thirty {
-      	width: 30%
-      }
-      
       .table {
       	width: 100%;
+      	table-layout: fixed;
       }
     </ui:style>
   <g:DockLayoutPanel ui:field="dock" unit="EX">
diff --git a/samples/showcase/src/com/google/gwt/sample/showcase/client/ContentWidget.java b/samples/showcase/src/com/google/gwt/sample/showcase/client/ContentWidget.java
index 2610237..6a22765 100644
--- a/samples/showcase/src/com/google/gwt/sample/showcase/client/ContentWidget.java
+++ b/samples/showcase/src/com/google/gwt/sample/showcase/client/ContentWidget.java
@@ -269,6 +269,15 @@
   }
 
   /**
+   * Check if the widget should have margins.
+   * 
+   * @return true to use margins, false to flush against edges
+   */
+  public boolean hasMargins() {
+    return true;
+  }
+
+  /**
    * Returns true if this widget has a style section.
    *
    * @return true if style tab available
@@ -302,7 +311,7 @@
    */
   @Override
   protected final Widget createWidget() {
-    view = new ContentWidgetView();
+    view = new ContentWidgetView(hasMargins());
     view.setName(getName());
     view.setDescription(getDescription());
     return view;
diff --git a/samples/showcase/src/com/google/gwt/sample/showcase/client/ContentWidgetView.java b/samples/showcase/src/com/google/gwt/sample/showcase/client/ContentWidgetView.java
index ae05d62..d97a092 100644
--- a/samples/showcase/src/com/google/gwt/sample/showcase/client/ContentWidgetView.java
+++ b/samples/showcase/src/com/google/gwt/sample/showcase/client/ContentWidgetView.java
@@ -17,6 +17,7 @@
 
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.dom.client.Element;
+import com.google.gwt.dom.client.Style.Unit;
 import com.google.gwt.uibinder.client.UiBinder;
 import com.google.gwt.uibinder.client.UiField;
 import com.google.gwt.user.client.ui.Composite;
@@ -44,8 +45,12 @@
   @UiField
   Element nameElem;
 
-  public ContentWidgetView() {
+  public ContentWidgetView(boolean hasMargins) {
     initWidget(uiBinder.createAndBindUi(this));
+    if (hasMargins) {
+      examplePanel.getElement().getStyle().setMarginLeft(10.0, Unit.PX);
+      examplePanel.getElement().getStyle().setMarginRight(10.0, Unit.PX);
+    }
   }
 
   public void setDescription(String html) {
diff --git a/samples/showcase/src/com/google/gwt/sample/showcase/client/ContentWidgetView.ui.xml b/samples/showcase/src/com/google/gwt/sample/showcase/client/ContentWidgetView.ui.xml
index 28dd32d..50c0594 100644
--- a/samples/showcase/src/com/google/gwt/sample/showcase/client/ContentWidgetView.ui.xml
+++ b/samples/showcase/src/com/google/gwt/sample/showcase/client/ContentWidgetView.ui.xml
@@ -8,13 +8,14 @@
       color: #4B4A4A;
       font-size: 17pt;
       font-weight: bold;
+      margin: 0px 10px;
     }
     
     .description {
       color: #4B4A4A;
       padding: 10px 0px;
       border-bottom: 1px solid #6F7277;
-      margin-bottom: 12px;
+      margin: 0px 10px 12px 10px;
     }
   </ui:style>
 
diff --git a/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseShell.java b/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseShell.java
index b24df5c..3ae557c 100644
--- a/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseShell.java
+++ b/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseShell.java
@@ -16,6 +16,7 @@
 package com.google.gwt.sample.showcase.client;
 
 import com.google.gwt.core.client.GWT;
+import com.google.gwt.dom.client.Style.Unit;
 import com.google.gwt.dom.client.TableCellElement;
 import com.google.gwt.dom.client.TableElement;
 import com.google.gwt.dom.client.Style.Display;
@@ -186,6 +187,8 @@
     initWidget(uiBinder.createAndBindUi(this));
     initializeLocaleBox();
     contentSource.getElement().getStyle().setBackgroundColor("#eee");
+    contentSource.getElement().getStyle().setMarginLeft(10.0, Unit.PX);
+    contentSource.getElement().getStyle().setMarginRight(10.0, Unit.PX);
     contentSource.getElement().getStyle().setProperty(
         "border", "1px solid #c3c3c3");
     contentSource.getElement().getStyle().setProperty("padding", "10px 2px");
diff --git a/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseShell.ui.xml b/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseShell.ui.xml
index 9a14f8f..5cdc5ac 100644
--- a/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseShell.ui.xml
+++ b/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseShell.ui.xml
@@ -109,7 +109,7 @@
     }
     
     .contentPanel {
-      padding: 10px;
+      padding: 10px 0px;
     }
   </ui:style>
 
diff --git a/samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/CwCellTable.java b/samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/CwCellTable.java
index c86b630..4a3cd7a 100644
--- a/samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/CwCellTable.java
+++ b/samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/CwCellTable.java
@@ -22,6 +22,7 @@
 import com.google.gwt.cell.client.TextCell;
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.core.client.RunAsyncCallback;
+import com.google.gwt.dom.client.Style.Unit;
 import com.google.gwt.i18n.client.Constants;
 import com.google.gwt.safehtml.shared.SafeHtmlUtils;
 import com.google.gwt.sample.showcase.client.ContentWidget;
@@ -109,6 +110,11 @@
     this.constants = constants;
   }
 
+  @Override
+  public boolean hasMargins() {
+    return false;
+  }
+
   /**
    * Initialize this example.
    */
@@ -122,6 +128,7 @@
     // change.
     cellTable = new CellTable<ContactInfo>(
         ContactDatabase.ContactInfo.KEY_PROVIDER);
+    cellTable.setWidth("100%", true);
 
     // Attach a column sort handler to the ListDataProvider to sort the list.
     ListHandler<ContactInfo> sortHandler = new ListHandler<ContactInfo>(
@@ -185,6 +192,7 @@
       }
     };
     cellTable.addColumn(checkColumn, SafeHtmlUtils.fromSafeConstant("<br/>"));
+    cellTable.setColumnWidth(checkColumn, 40, Unit.PX);
 
     // First name.
     Column<ContactInfo, String> firstNameColumn = new Column<ContactInfo, String>(
@@ -208,6 +216,7 @@
         ContactDatabase.get().refreshDisplays();
       }
     });
+    cellTable.setColumnWidth(firstNameColumn, 20, Unit.PCT);
 
     // Last name.
     Column<ContactInfo, String> lastNameColumn = new Column<ContactInfo, String>(
@@ -231,6 +240,7 @@
         ContactDatabase.get().refreshDisplays();
       }
     });
+    cellTable.setColumnWidth(lastNameColumn, 20, Unit.PCT);
 
     // Category.
     final Category[] categories = ContactDatabase.get().queryCategories();
@@ -257,6 +267,7 @@
         ContactDatabase.get().refreshDisplays();
       }
     });
+    cellTable.setColumnWidth(categoryColumn, 130, Unit.PX);
 
     // Address.
     Column<ContactInfo, String> addressColumn = new Column<ContactInfo, String>(
@@ -273,5 +284,6 @@
       }
     });
     cellTable.addColumn(addressColumn, constants.cwCellTableColumnAddress());
+    cellTable.setColumnWidth(addressColumn, 60, Unit.PCT);
   }
 }
diff --git a/samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/CwCellTable.ui.xml b/samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/CwCellTable.ui.xml
index c8b9518..6d85703 100644
--- a/samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/CwCellTable.ui.xml
+++ b/samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/CwCellTable.ui.xml
@@ -6,14 +6,14 @@
 
   <ui:style>
     .cellTable {
-      width: 600px;
-      border: 1px solid #ccc;
+      border-bottom: 1px solid #ccc;
       text-align: left;
+      margin-bottom: 4px;
     }
   </ui:style>
 
   <g:HTMLPanel>
-    <table>
+    <table cellspacing='0' cellpadding='0' style='width:100%;'>
       <tr>
         <td
           valign='top'>
diff --git a/user/src/com/google/gwt/dom/client/Style.java b/user/src/com/google/gwt/dom/client/Style.java
index b10a022..30bce70 100644
--- a/user/src/com/google/gwt/dom/client/Style.java
+++ b/user/src/com/google/gwt/dom/client/Style.java
@@ -483,6 +483,25 @@
   }
 
   /**
+   * Enum for the table-layout property.
+   */
+  public enum TableLayout implements HasCssName {
+    AUTO {
+      @Override
+      public String getCssName() {
+        return TABLE_LAYOUT_AUTO;
+      }
+    },
+    FIXED {
+      @Override
+      public String getCssName() {
+        return TABLE_LAYOUT_FIXED;
+      }
+    };
+    public abstract String getCssName();
+  }
+
+  /**
    * Enum for the text-decoration property.
    */
   public enum TextDecoration implements HasCssName {
@@ -687,6 +706,10 @@
   private static final String STYLE_BACKGROUND_IMAGE = "backgroundImage";
   private static final String STYLE_BACKGROUND_COLOR = "backgroundColor";
   private static final String STYLE_VERTICAL_ALIGN = "verticalAlign";
+  private static final String STYLE_TABLE_LAYOUT = "tableLayout";
+
+  private static final String TABLE_LAYOUT_AUTO = "auto";
+  private static final String TABLE_LAYOUT_FIXED = "fixed";
 
   private static final String TEXT_DECORATION_LINE_THROUGH = "line-through";
   private static final String TEXT_DECORATION_OVERLINE = "overline";
@@ -950,6 +973,13 @@
    }
 
   /**
+   * Clear the table-layout css property.
+   */
+  public final void clearTableLayout() {
+    clearProperty(STYLE_TABLE_LAYOUT);
+  }
+
+  /**
    * Clears the text-decoration CSS property.
    */
   public final void clearTextDecoration() {
@@ -1210,6 +1240,13 @@
   }
 
   /**
+   * Gets the table-layout property.
+   */
+  public final String getTableLayout() {
+    return getProperty(STYLE_TABLE_LAYOUT);
+  }
+
+  /**
    * Gets the text-decoration CSS property.
    */
   public final String getTextDecoration() {
@@ -1501,6 +1538,13 @@
   }
 
   /**
+   * Set the table-layout CSS property.
+   */
+  public final void setTableLayout(TableLayout value) {
+    setProperty(STYLE_TABLE_LAYOUT, value.getCssName());
+  }
+
+  /**
    * Sets the text-decoration CSS property.
    */
   public final void setTextDecoration(TextDecoration value) {
diff --git a/user/src/com/google/gwt/user/cellview/client/CellTable.css b/user/src/com/google/gwt/user/cellview/client/CellTable.css
index 71b07aa..6a73c90 100644
--- a/user/src/com/google/gwt/user/cellview/client/CellTable.css
+++ b/user/src/com/google/gwt/user/cellview/client/CellTable.css
@@ -32,6 +32,7 @@
   text-align: left;
   color: #4b4a4a;
   text-shadow: #ddf 1px 1px 0;
+  overflow: hidden;
 }
 
 .cellTableHeader {
@@ -40,10 +41,12 @@
   text-align: left;
   color: #4b4a4a;
   text-shadow: #ddf 1px 1px 0;
+  overflow: hidden;
 }
 
 .cellTableCell {
   padding: 2px 15px;
+  overflow: hidden;
 }
 
 .cellTableFirstColumnFooter {
diff --git a/user/src/com/google/gwt/user/cellview/client/CellTable.java b/user/src/com/google/gwt/user/cellview/client/CellTable.java
index 65330ab..4da9d35 100644
--- a/user/src/com/google/gwt/user/cellview/client/CellTable.java
+++ b/user/src/com/google/gwt/user/cellview/client/CellTable.java
@@ -26,6 +26,8 @@
 import com.google.gwt.dom.client.EventTarget;
 import com.google.gwt.dom.client.NodeList;
 import com.google.gwt.dom.client.Style.Display;
+import com.google.gwt.dom.client.Style.TableLayout;
+import com.google.gwt.dom.client.Style.Unit;
 import com.google.gwt.dom.client.TableCellElement;
 import com.google.gwt.dom.client.TableColElement;
 import com.google.gwt.dom.client.TableElement;
@@ -55,8 +57,10 @@
 import com.google.gwt.view.client.SelectionModel;
 
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
 /**
@@ -478,11 +482,11 @@
     return DEFAULT_RESOURCES;
   }
 
+  final TableColElement colgroup;
   private boolean cellIsEditing;
 
-  private final TableColElement colgroup;
-
   private final List<Column<T, ?>> columns = new ArrayList<Column<T, ?>>();
+  private final Map<Column<T, ?>, String> columnWidths = new HashMap<Column<T, ?>, String>();
 
   /**
    * Indicates that at least one column depends on selection.
@@ -735,6 +739,16 @@
   }
 
   /**
+   * Clear the width of the specified {@link Column}.
+   * 
+   * @param column the column
+   */
+  public void clearColumnWidth(Column<T, ?> column) {
+    columnWidths.remove(column);
+    refreshColumnWidths();
+  }
+
+  /**
    * Return the height of the table body.
    * 
    * @return an int representing the body height
@@ -770,7 +784,7 @@
    * @param column the column to search for
    * @return the index of the column, or -1 if not found
    */
-  public int getColumnIndex(Column<T,?> column) {
+  public int getColumnIndex(Column<T, ?> column) {
     return columns.indexOf(column);
   }
 
@@ -943,6 +957,12 @@
         new SafeHtmlHeader(footerHtml));
   }
 
+  @Override
+  public void redraw() {
+    refreshColumnWidths();
+    super.redraw();
+  }
+
   /**
    * Redraw the table's footers.
    */
@@ -1020,6 +1040,32 @@
   }
 
   /**
+   * Set the width of a {@link Column}. The layout behavior depends on whether
+   * or not the table is using fixed layout.
+   * 
+   * @param column the column
+   * @param width the width of the column
+   * @see #setTableLayoutFixed(boolean)
+   */
+  public void setColumnWidth(Column<T, ?> column, String width) {
+    columnWidths.put(column, width);
+    refreshColumnWidths();
+  }
+
+  /**
+   * Set the width of a {@link Column}. The layout behavior depends on whether
+   * or not the table is using fixed layout.
+   * 
+   * @param column the column
+   * @param width the width of the column
+   * @param unit the {@link Unit} of measurement
+   * @see #setTableLayoutFixed(boolean)
+   */
+  public void setColumnWidth(Column<T, ?> column, double width, Unit unit) {
+    setColumnWidth(column, width + unit.getType());
+  }
+
+  /**
    * Sets the object used to determine how a row is styled; the change will take
    * effect the next time that the table is rendered.
    * 
@@ -1029,6 +1075,62 @@
     this.rowStyles = rowStyles;
   }
 
+  /**
+   * <p>
+   * Enable or disable fixed table layout.
+   * </p>
+   * 
+   * <p>
+   * <h1>Fixed Table Layout</h1>
+   * When using the fixed table layout, cell contents are truncated as needed,
+   * which allows you to set the exact width of columns and the table. The
+   * default column width is 0 (invisible). In order to see all columns, you
+   * must set the width of the table (recommended 100%), or set the width of
+   * every column in the table. The following conditions are true for fixed
+   * layout tables:
+   * <ul>
+   * <li>
+   * If the widths of <b>all</b> columns are set, the width becomes a weight and
+   * the columns are resized proportionally.</li>
+   * <li>If the widths of <b>some</b> columns are set using absolute values
+   * (PX), those columns are fixed and the remaining width is divided evenly
+   * over the other columns. If there is no remaining width, the other columns
+   * will not be visible.</li>
+   * <li>If the width of some columns are set in absolute values (PX) and others
+   * are set in relative values (PCT), the absolute columns will be fixed and
+   * the remaining width is divided proportionally over the PCT columns. This
+   * allows users to define how the remaining width is allocated.</li>
+   * </ul>
+   * </p>
+   * 
+   * @param isFixed true to use fixed table layout, false not to
+   * @see <a href="http://www.w3.org/TR/CSS2/tables.html#width-layout">W3C HTML
+   *      Specification</a>
+   */
+  public void setTableLayoutFixed(boolean isFixed) {
+    if (isFixed) {
+      table.getStyle().setTableLayout(TableLayout.FIXED);
+    } else {
+      table.getStyle().clearTableLayout();
+    }
+  }
+
+  /**
+   * Set the width of the width and specify whether or not it should use fixed
+   * table layout. See {@link #setTableLayoutFixed(boolean)} for more
+   * information about fixed layout tables.
+   * 
+   * @param width the width of the table
+   * @param isFixedLayout true to use fixed width layout, false not to
+   * @see #setTableLayoutFixed(boolean)
+   * @see <a href="http://www.w3.org/TR/CSS2/tables.html#width-layout">W3C HTML
+   *      Specification</a>
+   */
+  public final void setWidth(String width, boolean isFixedLayout) {
+    super.setWidth(width);
+    setTableLayoutFixed(isFixedLayout);
+  }
+
   @Override
   protected Element convertToElements(SafeHtml html) {
     return TABLE_IMPL.convertToSectionElement(CellTable.this, "tbody", html);
@@ -1753,6 +1855,29 @@
     return consumedEvents != null && consumedEvents.size() > 0;
   }
 
+  private void refreshColumnWidths() {
+    int columnCount = getColumnCount();
+    for (int i = 0; i < columnCount; i++) {
+      Column<T, ?> column = columns.get(i);
+      String width = columnWidths.get(column);
+      if (width == null) {
+        ensureTableColElement(i).getStyle().clearWidth();
+      } else {
+        ensureTableColElement(i).getStyle().setProperty("width", width);
+      }
+    }
+
+    /*
+     * Set the width to zero for all col elements that appear after the last
+     * column. Clearing the width would cause it to take up the remaining width
+     * in a fixed layout table.
+     */
+    int colCount = colgroup.getChildCount();
+    for (int i = columnCount; i < colCount; i++) {
+      ensureTableColElement(i).getStyle().setWidth(0.0, Unit.PX);
+    }
+  }
+
   private <C> boolean resetFocusOnCellImpl(int row, int col, Column<T, C> column) {
     Element parent = getKeyboardSelectedElement();
     T value = getVisibleItem(row);
diff --git a/user/src/com/google/gwt/user/cellview/client/CellTableBasic.css b/user/src/com/google/gwt/user/cellview/client/CellTableBasic.css
index f143f6d..c34771c 100644
--- a/user/src/com/google/gwt/user/cellview/client/CellTableBasic.css
+++ b/user/src/com/google/gwt/user/cellview/client/CellTableBasic.css
@@ -34,7 +34,8 @@
   padding: 0px 10px;
   text-align: left;
   color: #4b4a4a;
-  text-shadow: #ddf 1px 1px 0
+  text-shadow: #ddf 1px 1px 0;
+  overflow: hidden;
 }
 
 @sprite .cellTableHeader {
@@ -47,10 +48,12 @@
   text-align: left;
   color: #4b4a4a;
   text-shadow: #ddf 1px 1px 0;
+  overflow: hidden;
 }
 
 .cellTableCell {
   padding: 4px 10px;
+  overflow: hidden;
 }
 
 .cellTableFirstColumnFooter {
diff --git a/user/test/com/google/gwt/dom/client/StyleTest.java b/user/test/com/google/gwt/dom/client/StyleTest.java
index 9e17047..a3d64c0 100644
--- a/user/test/com/google/gwt/dom/client/StyleTest.java
+++ b/user/test/com/google/gwt/dom/client/StyleTest.java
@@ -33,6 +33,7 @@
 import com.google.gwt.dom.client.Style.ListStyleType;
 import com.google.gwt.dom.client.Style.Overflow;
 import com.google.gwt.dom.client.Style.Position;
+import com.google.gwt.dom.client.Style.TableLayout;
 import com.google.gwt.dom.client.Style.TextDecoration;
 import com.google.gwt.dom.client.Style.VerticalAlign;
 import com.google.gwt.dom.client.Style.Visibility;
@@ -199,6 +200,16 @@
     assertEquals(Position.FIXED, style.getPosition());
   }
 
+  public void testTableLayout() {
+    TableElement table = Document.get().createTableElement();
+    Style style = table.getStyle();
+
+    style.setTableLayout(TableLayout.AUTO);
+    assertEquals(TableLayout.AUTO, style.getTableLayout());
+    style.setTableLayout(TableLayout.FIXED);
+    assertEquals(TableLayout.FIXED, style.getTableLayout());
+  }
+
   public void testTextDecoration() {
     DivElement div = Document.get().createDivElement();
     Style style = div.getStyle();
diff --git a/user/test/com/google/gwt/user/cellview/client/CellTableTest.java b/user/test/com/google/gwt/user/cellview/client/CellTableTest.java
index 6585f0e..9147ffd 100644
--- a/user/test/com/google/gwt/user/cellview/client/CellTableTest.java
+++ b/user/test/com/google/gwt/user/cellview/client/CellTableTest.java
@@ -20,11 +20,13 @@
 import com.google.gwt.cell.client.TextCell;
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.dom.client.Document;
+import com.google.gwt.dom.client.Element;
 import com.google.gwt.dom.client.NativeEvent;
 import com.google.gwt.dom.client.TableCellElement;
 import com.google.gwt.dom.client.TableElement;
 import com.google.gwt.dom.client.TableRowElement;
 import com.google.gwt.dom.client.TableSectionElement;
+import com.google.gwt.dom.client.Style.Unit;
 import com.google.gwt.safehtml.shared.SafeHtml;
 import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
 import com.google.gwt.user.cellview.client.CellTable.Resources;
@@ -383,6 +385,59 @@
         styleLastColumn));
   }
 
+  /**
+   * Test that removing a column sets its width to zero.
+   */
+  public void testRemoveColumnWithWidth() {
+    CellTable<String> table = createAbstractHasData(new TextCell());
+    Column<String, ?> column1 = table.getColumn(1);
+    table.setColumnWidth(column1, "100px");
+    Element col0 = table.colgroup.getFirstChildElement();
+    Element col1 = col0.getNextSiblingElement();
+    assertEquals("100px", col1.getStyle().getWidth().toLowerCase());
+
+    // Remove column 1.
+    table.removeColumn(column1);
+    assertEquals("0px", col1.getStyle().getWidth());
+  }
+
+  public void testSetColumnWidth() {
+    CellTable<String> table = createAbstractHasData(new TextCell());
+    Column<String, ?> column0 = table.getColumn(0);
+    Column<String, ?> column1 = table.getColumn(1);
+
+    // Set the width.
+    table.setColumnWidth(column1, "100px");
+    Element col0 = table.colgroup.getFirstChildElement();
+    Element col1 = col0.getNextSiblingElement();
+    assertEquals("", col0.getStyle().getWidth());
+    assertEquals("100px", col1.getStyle().getWidth().toLowerCase());
+
+    // Clear the width.
+    table.clearColumnWidth(column1);
+    assertEquals("", col0.getStyle().getWidth());
+    assertEquals("", col1.getStyle().getWidth());
+
+    // Set the width again.
+    table.setColumnWidth(column0, 30.1, Unit.PCT);
+    assertEquals("30.1%", col0.getStyle().getWidth().toLowerCase());
+    assertEquals("", col1.getStyle().getWidth());
+  }
+
+  public void testSetTableLayoutFixed() {
+    CellTable<String> table = createAbstractHasData(new TextCell());
+    assertNotSame("fixed",
+        table.getElement().getStyle().getTableLayout());
+
+    table.setTableLayoutFixed(true);
+    assertEquals("fixed",
+        table.getElement().getStyle().getTableLayout());
+
+    table.setTableLayoutFixed(false);
+    assertNotSame("fixed",
+        table.getElement().getStyle().getTableLayout());
+  }
+
   public void testSortableColumn() {
     CellTable<String> table = createAbstractHasData(new TextCell());
     table.getColumn(0).setSortable(true);