2

I am using ojtable where I want each column to be of fixed size. Whenever the text is too long in any of the column it stretches the table. Is there a possibility to wrap the text instead of stretching the column in ojtable?

SK01
  • 43
  • 1
  • 9
  • check the following answer here : https://stackoverflow.com/a/10799399/957654 and here https://stackoverflow.com/a/1883702/957654 –  Aug 09 '17 at 12:55

2 Answers2

2

You can use the OJET sample from the cookbook. In your columns definition, you should set a style property:

"style": "white-space:normal;word-wrap:break-word; text-align: left;vertical-align: top;"

However, the best way is to create a class and set the class property; component CSS file:

.table-world-wrap {
  white-space:normal;word-wrap:break-word; text-align: left;vertical-align: top;
}

component controller:

columns = [{
  headerText: 'your column header',
  field: 'you data field name',
  className: 'table-world-wrap'
}];
0

You could try setting the table cell to overflow: hidden.

Koshinae
  • 2,240
  • 2
  • 30
  • 40