Passing a class to prevent text overflow does not work as expected.
If I try to pass a column definition to prevent text overflow like such
const columns = [
...
{
key: 'problem',
name: 'Problem',
cellClass: 'no-overflow',
}
...
];
the class is defined like so
.no-overflow {
text-overflow: ellipsis;
}
The cell does not prevent text from overflowing to the next line
Was able to, solve with some css, basically you need to target the div that owns the text
.no-overflow .react-grid-Cell__value div {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
It's a lil odd and maybe can be a built in to the column properties, but that would be an enhancement
Thanks for posting your solution to this, Dan - helped me.
@danfernand But it is not working for custom components in table cell. Please suggest some workaround..
I was able to enable text wrapping with a CSS workaround:
this is the result:

to achieve this, I just:
- added the property
cellClass: css.myClassThatEnablesTextWrappingto each item of the columns - and this is the content of the CSS class:
.myClassThatEnablesTextWrapping {
text-overflow: ellipsis;
white-space: break-spaces;
overflow-y: auto;
// this is another workaround that makes the scroll appears only for cases where it is really necessary
height: calc(100% + 2%);
}
This solution works for:
- ✅ editable cells
- ✅ resizable cells