def resizeEvent(self, event):

        QtGui.QTableView.resizeEvent(self, event)

        if self._editor.auto_size:
            self.resizeColumnsToContents()
            self.resizeRowsToContents()

        else:
            parent = self.parent()
            if (not self._initial_size and parent and
                (self.isVisible() or isinstance(parent, QtGui.QMainWindow))):
                self._initial_size = True
                if self._editor.auto_size:
                    self.resizeColumnsToContents()
                    self.resizeRowsToContents()
Reimplemented to size the table columns when the size of the table
dataset/ETHPy150Open enthought/traitsui/traitsui/qt4/table_editor.py/TableView.resizeEvent