2013-03-21 68 views
0

我要追加DIV内< TH>在GWTGWT DOM不工作

Element tr = DOM.createTR(); 

DOM.appendChild(thead, tr); 
for (int index = 0; index < headers.size(); index++) { 
Element th = DOM.createTH(); 

Element div = DOM.createDiv(); 

DOM.appendChild(th, div); // this is not working ! 
DOM.appendChild(tr, th); 

} 

是什么东西错在我的代码?

+0

你如何创建THEAD?什么不工作?给编译时间错误?运行时错误? – 2013-03-21 10:18:26

+0

using thead = DOM.createElement(“thead”); 我创建THEAD ...... – 2013-03-21 11:00:39

+0

我想

2013-03-21 11:01:24

回答

-1

我认为它会给你编译时错误,因为方法`DOM.appendChild(th,div);'第二个参数应该是封装结构的一部分:

com.google.gwt.user.client.Element 

,而不是

com.google.gwt.dom.client.Element