I have a table inside a content panel with a top toolbar and a bottom paging toolbar. The table is too wide and spans outside the content panel container. This is in IE standalone and hosted mode. It looks correct in FF. I have attached a screenshot and the code below shows how the table is setup.
I can get it to look ok if I set an explicit width (900). I've tried with setAutoWidth(true). The result I want is for it to automatically fill the width, the same way the toolbars are doing. Is see it as a big problem if you have to specify a fixed width and height (can I get the height to auto size depending on content?) for the UI to align correctly. In the end it's all rendered as a DOM tree and these things are pretty straightforward in plain old HTML.
The code below shows how my class which is exending the ContentPanel class is setup.
Code:
final protected ToolBar toolBar = new ToolBar();
final PagingToolBar pagingBar = new PagingToolBar(50);
final protected Table table = new Table();
@Override
protected void onRender(Element parent, int index) {
super.onRender(parent, index);
setHeaderVisible(false);
setBorders(false);
setLayout(new FillLayout());
table.setSelectionModel(new RowSelectionModel(SelectionMode.SINGLE));
table.setBorders(false);
table.setHeight(300);
List<TableColumn> columns = new ArrayList<TableColumn>();
columns.add(new TableColumn(EmployeeProperties.FIRSTNAME, res.firstNameLbl(), .2f));
columns.add(new TableColumn(EmployeeProperties.LASTNAME, res.lastNameLbl(), .2f));
columns.add(new TableColumn(EmployeeProperties.USERID, res.userIdLbl(), .1f));
columns.add(new TableColumn(EmployeeProperties.SAPID, res.sapIdLbl(), .1f));
columns.add(new TableColumn(EmployeeProperties.POSITION, res.positionLbl(), .2f));
columns.add(new TableColumn(EmployeeProperties.WORKPERCENTAGE, res.workPercentageLbl(), .1f));
TableColumn col = new TableColumn(EmployeeProperties.STARTDATE, res.startDateLbl(), .1f);
col.setRenderer(new DateTimeCellRenderer("y-MM-dd"));
columns.add(col);
table.setColumnModel(new TableColumnModel(columns));
editBtn = new TextToolItem(globalResources.editBtn(), "icon-add");
editBtn.setEnabled(false);
toolBar.add(editBtn);
toolBar.add(new SeparatorToolItem());
add(table);
setTopComponent(toolBar);
setBottomComponent(pagingBar);
layout();
}