0

I need the Cell Table Column Alignment to be on Right/Center.Is it Possible to do using any GWT CellTable API Method? How to Achieve this?Any suggestion enter image description here

moh
  • 1,426
  • 2
  • 16
  • 43

1 Answers1

0

Here is a good answer how to add a style name to a cell.

Dynamic styles for GWT cellTable cells

A solution can look like this:

t.addColumn(new TextColumn<String>()
        {

            @Override
            public String getValue(String object)
            {
                return object;
            }

            @Override
            public String getCellStyleNames(Context context, String object)
            {

                return super.getCellStyleNames(context, object) + " right";
            }
        });

in your css class add:

.right{
    text-align: right;
}
Community
  • 1
  • 1