2013-02-07 9 views
0

ZUL 프레임 워크에서 colspan의 속성을 설정하는 방법은 무엇입니까?ZK/Zul에서 프로그래밍 방식으로 colspan을 추가하는 방법은 무엇입니까?

Tr tr = new Tr(); 

Td td = new Td(); 

tr.appendChild(td); 


td = new Td(); 

tr.appendChild(td); 

이제 다음 행에서 두 개의 공간을 차지할 작곡가를 통해 테이블 ​​행 안에 하나의 TD를 넣어야합니다. 내가 어떻게 이걸 얻을 수 있니?

<Table> 
    <tr> 
     <td> 
     </td/> 
     <td> 
     </td> 
    </tr> 
    <tr> 
     <td colspan="2"> 
     </td> 
    </tr> 
</table> 
+0

질문을 업데이트 할 수 있습니까? 당신이

을해야합니까 –

답변

2

는 ZUL에서이 <table>, <tr><td> 태그 할 것이 아니라 <grid>, <row><cell> 태그. 자바 측에서

<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> 

.. 그래서 같이, 다음,이

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 

자세한 내용은 (큰) ZK docs을 참조하시기 바랍니다 .. 쉽게된다.