0

I implemented my own widget by extending GWT CellTable. I am now looking to remove the 2px table borders that GWT has by default on the table. Here is the structure of my custom widget:

public class CustomWidget extends CellTable {

public CustomWidget (DataModel _dataModel, Updater _updater) { ... } }

I saw a related answer here on StackOveflow and followed those steps. However, I extend CellTable to create my own widget, which is different from the original post where an instance of a basic CellTable is created. The step I need help with is how to tweak the following line of code, given in the other post, to provide a new Resources class to my custom CellTable widget:

CellTable myCellTable = new CellTable(15, GWT.create(TableResources.class));

where TableResources extends CellTable.Resources.

Community
  • 1
  • 1
Darkane
  • 63
  • 1
  • 9

1 Answers1

0

One way to do this is to define a css class (somewhere you make sure that it loads in your target page):

.myBorderlessCell
{
    border: 0;
}

and then in your java code:

CustomWidget cw = new CustomWidget(...);
cw.addStyleName("myBorderlessCell");

this overrides border attribute of your widget.

Ehsan Khodarahmi
  • 4,772
  • 10
  • 60
  • 87