Easiest way to enable text wrapping?
Hi and once again, thanks for this great component!
I have a row with a "description" column that truncates its text when it overflows. What's the easiest way to allow the row height to expand to accommodate text wrapping?
Thanks, Alvaro
I literally had to figure this out with the help of the contributors.
https://github.com/adazzle/react-data-grid/issues/245
hey @alvaro1728 -- see @danfernand 's linked issue above if you want to include an ellipses for the text overflow.
if you wanted something more like dynamic height which automatically expands a row, we don't have anything like that currently... You could pass in a custom rowHeight to the grid, but at the moment this will apply to all rows.
do either of those options suit your use case?
Hi @danfernand and @jpdriver, thanks for your replies.
I guess I was looking more for the typical HTML table behavior where if a td has too much text, it automatically wraps it and makes that row taller. However... I came up with a slicker solution, or so I think. :-) I'm wrote some jquery/css code that attaches a mouseenter event to my "description" cells to dynamically expand their height and show the full text.


Let me know if you're interested in my concoction.
Thanks, Alvaro
nice! any chance you could open a PR for it? think we'd definitely be interested to see :smile:
Will close as it is a duplicated for #102
@alvaro1728 How did you calculate the height that you need to expand the row?
Any update on this feature ?
This library releasing new version on every month like angular, but still not solved dynamic row height related issue which is most used in data table. After spending 2 month in my project, and this issue forcing me to adopting another table library.
@rao123dk Can you please share the library that you used to achieve dynamic row height?
@rao123dk Can you please share the library that you used to achieve dynamic row height?
https://github.com/DevExpress/devextreme-reactive .
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
.test {
display: inline-block;
line-height: 1.5;
overflow-wrap: break-word;
white-space: normal;
text-align: justify;
}