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.

1 Answer 1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.