data.right = new FormAttachment(100,0);
table.setLayoutData(data);
}
private void createColumns(final Table table) {
final TableLayout layout = new TableLayout();
for (int i = 0; i < weekDays.length; i++) {
if(i==0)
layout.addColumnData(new ColumnWeightData(10, true));
else
layout.addColumnData(new ColumnWeightData(50, true));
TableColumn col = new TableColumn(table, SWT.CENTER);
col.setResizable(true);
col.setText(weekDays[i]);
}
table.setLayout(layout);
table.addListener(SWT.Resize, new Listener(){
public void handleEvent(Event arg0) {
final TableLayout layout = new TableLayout();
for (int i = 0; i < weekDays.length; i++) {
if(i==0)
layout.addColumnData(new ColumnWeightData(10, true));
else
layout.addColumnData(new ColumnWeightData(50, true));
}
table.setLayout(layout);
}
});
}