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?
Asked
Active
Viewed 1,475 times
2
-
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 Answers
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'
}];

user1848754
- 44
- 3