How do I style a gwt 2.1 CellTables headers?

前端 未结 4 1153
离开以前
离开以前 2020-12-03 08:29

I see nothing in the documentation except a reference to include some \"CssResource\" and get it with ClientBundle, but how do I exactly override the tbody and th of a CellT

4条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-03 09:00

    Create an interface:

      interface TableResources extends CellTable.Resources {
        @Source({CellTable.Style.DEFAULT_CSS, ".css"})
        TableStyle cellTableStyle();
      }
    
      interface TableStyle extends CellTable.Style {
      }
    

    and initialize the cell table:

        CellTable.Resources resources = GWT.create(TableResources.class);
        table = new CellTable(rowSize, resources);
    

    In the cellview.client package you can find the default gwt css files. Yo use those as your starting point. In the ".css" put you specific style changes.

    You can also set colum style (on the col element):

    table.addColumnStyleName(colNumer, "some_css_style_name");
    

    or better use css resource name instead of string "some_css_style_name".

提交回复
热议问题