code: public static void ensureCellTableParentResize(final CellTable<?> table) {
  
          // we need to update the scroll panel when the table is redrawn, but the redraw() method of the table is asynchronous,
          // i.e. it only schedules an actual redraw. However, the method which is responsible for the actual redrawing triggers a
          // loading state event before it does the redrawing. Using a timer at this point, we can execute code after the redrawing
          // has happend.
          table.addLoadingStateChangeHandler(new LoadingStateChangeEvent.Handler() {
  
              public void onLoadingStateChanged(LoadingStateChangeEvent event) {
  
                  Timer resizeTimer = new Timer() {
  
                      @Override
                      public void run() {
  
                          CmsDomUtil.resizeAncestor(table);
                      }
                  };
                  resizeTimer.schedule(10);
              }
          });
      }
docs: Ensures that surrounding scroll panels are notified when a table changes size.<p>
  
  @param table the table for which the parent scroll panels should be notified