0

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

WelcomeTo
  • 19,843
  • 53
  • 170
  • 286

1 Answers1

2

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");
Hardik Mishra
  • 14,779
  • 9
  • 61
  • 96