2011-06-09 61 views
0

我正在使用gwt创建一个表格,我添加了一些边框。 FxGWT:解析CSS样式属性

DOM.setStyleAttribute(cellElement, "border-left", "solid"); 
DOM.setStyleAttribute(cellElement, "border-right", "double"); 
... 

不同的浏览器然后设置非常不同的样式。特别是边界财产。这可能是

border-left: solid 1px; 
border-right: double 2px; 

border-style-left: solid; 
border-width-left: 1px; 
border-style-right: double; 
border-width-left: 2px; 

,甚至作为一个单一的财产

border: solid none double none; 
... 

是在某些方面,这些不同的编写相同的方式能够被解析,以便它会更容易找到表格的边框属性。喜欢的东西:

border-left: solid; 
border-top: none; 
border-right: double; 
border-bottom: none; 
border-width-left: 1px; 
border-width-top: 1px; 
... 

而且解析应该在客户端

回答

1

currentStyle/getComputedStyle()做将有助于利用,只要元素已呈现。您需要编写一个JSNI方法来访问它,因为在DOM包中似乎没有这种API封装。