0
votes

I want to set fixed column width, but when content (String) is longer than width of column, then width of column stretch to width of string. enter image description here

But I need to have static width of column, not modifiable, and when content is longer, then transfer content to the next line. Thanks

1

1 Answers

2
votes

Assuming you have code

cellTable.addColumn(column1);
cellTable.addColumn(column2);
cellTable.setColumnWidth(column1, 120.0, Unit.PX);
cellTable.setColumnWidth(column2, 350.0, Unit.PX);

in you style.css

.wordWrap{
 width:100%;
 word-wrap: break-word;
}

Then Set CSS

cellTable.setStyleName("wordWrap");