Question

I'm implementing a table which has both colspan and rowspan cells. I used FlexTable before but decided to use CellTable. But it looks like CellTable does not support adding style while FlexTable did... Please look at the picture to know what I'm trying to do:

Any suggestions are welcome.

Was it helpful?

Solution

You can use an AbstractCellTableBuilder to render your own strucuture.
Have a look at the Custom DataGrid showcase.

OTHER TIPS

;
    FlexTable table = new FlexTable();
    FlexTable.FlexCellFormatter flexCellFormatter =table.getFlexCellFormatter();
    flexCellFormatter.setColSpan(3,0,2);
    final TextBox textBox = new TextBox();
    Label label = new Label();
    label.setText("Name");
    table.setWidget(0, 0, label);
    table.setWidget(0, 1, textBox);
    final TextBox textBox1 = new TextBox();
    Label label1 = new Label();
    label1.setText("Surname");
    table.setWidget(1,0,label1);
    table.setWidget(1, 1, textBox1);
    final TextBox textBox2 = new TextBox();
    Label label2 = new Label();
    label2.setText("e-mail");
    table.setWidget(2,0, label2);
    table.setWidget(2, 1, textBox2);

    Button button = new Button("apply", new ClickHandler() {
        @Override``
        public void onClick(ClickEvent event) {
            String name = textBox.getText();
            String surname = textBox1.getText();
            Window.alert("Your name is " + name + "Your surname is " + surname);
        }
    });
    table.setWidget(3, 0, button);//Write this code, then run, you can answer! goodLuck :-))
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top