[A] [B] [C]谷歌Web工具包 - Flextable CSS
flextable1.setWidget(0, 0, new Label("a"));
flexTable1.setWidget(0, 1, new Label("b"));
flexTable1.setWidget(0, 2, new Label("c"));
我想设置的橙色背景颜色仅列。如何设置?请帮帮我。谢谢。
[A] [B] [C]谷歌Web工具包 - Flextable CSS
flextable1.setWidget(0, 0, new Label("a"));
flexTable1.setWidget(0, 1, new Label("b"));
flexTable1.setWidget(0, 2, new Label("c"));
我想设置的橙色背景颜色仅列。如何设置?请帮帮我。谢谢。
试试这个:
public void onModuleLoad() {
FlexTable flexTable1 = new FlexTable();
Label a = new Label("a");
flexTable1.setWidget(0, 0, a);
flexTable1.setWidget(0, 1, new Label("b"));
flexTable1.setWidget(0, 2, new Label("c"));
//add your widget to your panel, I used RootPanel directly for this example.
RootPanel.get().add(flexTable1);
a.getElement().getStyle().setBackgroundColor("orange");
}
尝试用CSS风格,是更易于管理。 如果你想在将来改变它,那么你不需要触摸JAVA代码。
以这种方式您可以受益于主题。
JAVA:
// set style for first row and first column
flexTable.getFlexCellFormatter().setStyleName(0, 0,"yellowBackground");
CSS:
.yellowBackground {
background-color: yellow;
}
谢谢你,Braj。 – user3007865
根本不是。别客气。 – Braj
非常感谢你,apanizo。 – user3007865
无论如何,如果您与我们分享更多信息,我们可以为您提供更完整的答案,例如使用UiBinder,CssResources或GQuery。快乐的编码方式。 – apanizo
不客气! – apanizo