In ZUL this is not done with <table>
, <tr>
, and <td>
tags but with <grid>
, <row>
, and <cell>
tags. Like so..
<grid>
<columns>
<column label="A" />
<column label="B" />
</columns>
<rows>
<row>
<cell>
<label value="item 1" />
</cell>
<cell>
<label value="item 2" />
</cell>
</row>
<row>
<cell colspan="2">
<label value="item 3" />
</cell>
</row>
</rows>
</grid>
From the Java side, then, this becomes easy..
Grid grid = new Grid();
Rows rows = new Rows();
rows.setParent(grid);
Row row1 = new Row();
row1.setParent(rows);
Cell cell1 = new Cell();
cell1.setParent(row1);
cell1.appendChild(new Label("item1"));
Cell cell2 = new Cell();
cell2.setParent(row1);
cell2.appendChild(new Label("item2"));
Row row2 = new Row();
row2.setParent(rows);
Cell cell3 = new Cell();
cell3.setParent(row2);
cell3.appendChild(new Label("item3"));
cell3.setColspan(2); // this is what you're looking for
Please refer to the (great) ZK docs for more information.