Material-table: Text Overflow: ellipsis

Created on 24 Feb 2019  路  4Comments  路  Source: mbrn/material-table

I have created a smaller width table. The cell of one column sometimes will have very long pieces of text. Currently the cell body keeps wrapping/stacking on top of each other and the row grows exponentially large in the table. Is there a way to do turn this cell into an ellipsis? I tried using cellStyle with textOverflow: ellipsis, but it did not work.

image

help wanted

Most helpful comment

Hi @vinceliu21 ,

Can you try this cellStyle

cellStyle: { textOverflow: 'ellipsis', whiteSpace: 'nowrap', overflow: 'hidden', maxWidth: 100}

All 4 comments

Hi @vinceliu21 ,

I will try your case asap.

Thanks! Let me know if you want to see the code I tried or more pictures. Preferably, I would like the rows to stay the same size instead of having one row of data be 3x the size of another because the text in a cell was too long.

Hi @vinceliu21 ,

Can you try this cellStyle

cellStyle: { textOverflow: 'ellipsis', whiteSpace: 'nowrap', overflow: 'hidden', maxWidth: 100}

I was going to ask about the possibility of displaying the full text in a tooltip, then I thought that it is better to show this in a detail component

Was this page helpful?
0 / 5 - 0 ratings

Related issues

behrouz-s picture behrouz-s  路  3Comments

jlgreene2 picture jlgreene2  路  3Comments

diegosps picture diegosps  路  3Comments

bohrsty picture bohrsty  路  3Comments

victorwvieira picture victorwvieira  路  3Comments