我正在使用gwt创建一个我在其中添加一些边框的表格。外汇

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


并且解析应该在客户端进行

最佳答案

只要该元素已经被渲染,currentStyle / getComputedStyle()就可以帮助您。您需要编写一个JSNI方法来访问它,因为DOM包中似乎没有对此的API包装器。

09-10 06:41
查看更多