60
Views
16
Comments
Allow Column text wrapping in table

Hi All,

I have more columns in the table, to avoid scrolling client requested to allow text wrapping for columns with bigger text.

I am doing it by removing  white-space: nowrap; css of the table, but then other table columns are also getting affected like some are moving up, some down.

Can someone please suggest any solution for this.


Thanks

Shivangi

2024-12-02 13-16-47
Vipin Yadav

Hi @Shivangi Thakur,

Instead of removing white-space: nowrap; globally for the entire table, apply CSS to specific columns that need text wrapping. 

Assign a Class to the Specific Column:

  • In the Table Records widget or the Data Grid, locate the column you want to wrap text for.
  • Go to the column’s Style Classes property.
  • Add a custom class, e.g., wrap-text-column.

CSS -

/* Allow text wrapping only for specific columns */

.table .wrap-text-column {

    white-space: normal; /* Allow text to wrap */

    word-wrap: break-word; /* Break long words */

}


/* Prevent other columns from wrapping */

.table td {

    white-space: nowrap; /* Retain nowrap for all other columns */

}

Thanks,

Vipin Yadav


2019-03-12 12-28-20
Shivangi Thakur

Hi,

This is not working, can you provide oml ?


Thanks

Shivangi

2024-12-02 13-16-47
Vipin Yadav

@Shivangi ThakurCould you please share your OML file with me? I'll make the necessary changes. 

Thanks,

Vipin Yadav


2025-12-04 09-01-03
Kiet Phan
Champion

Hi @Shivangi Thakur 

Did you try this css. It works for me.

word-break: break-all; 

2019-03-12 12-28-20
Shivangi Thakur

Hi,


Please provide oml if it works for you. Also I do not need sorting to display below text.

Thanks


2020-07-21 19-28-50
Rajat Agrawal
Champion

Hi @Shivangi Thakur,

Please find below attached OML i did some changes as per your requirement please refer it.



Regards,

Rajat

TableColumn.oml
2019-03-12 12-28-20
Shivangi Thakur

Hi,


I do not need sorting icon to come down, 

I tried fixing it but then other will be impacted if i apply width and it will be inline css which i do not want to use.



Thanks

Shivangi

2024-03-12 10-44-32
Ram Kumar Baghel

hi @Shivangi Thakur
 for this You can remove the Sorting Attribute


2019-03-12 12-28-20
Shivangi Thakur

Hi Rajat,


Oml is still old one only.


Thanks

Shivangi

2020-07-21 19-28-50
Rajat Agrawal
Champion

ok I will check and update on that.


Regards,

Rajat

2020-07-21 19-28-50
Rajat Agrawal
Champion

please find below attachment.



Regards,

Rajat

TableColumn.oml
2019-03-12 12-28-20
Shivangi Thakur

Hi,

I have attached the oml below for ease, the point is the columns with large text needs to be wrap in 2 lines instead of 3 and sorting icon should be beside the text not below it.


Thanks

TableUITest.oml
2020-07-21 19-28-50
Rajat Agrawal
Champion

Hi @Shivangi Thakur,

Please check OML I updated you code now icon come in a one line.

TableUITest.oml
2024-03-12 10-44-32
Ram Kumar Baghel

Hi @Shivangi Thakur
  please try this CSS.

 .table-header th {    white-space: normal;}

 it works for me .

 regards 

 Ram baghel


2025-06-04 14-48-57
Nguyen Huy Hoang

Hi @Shivangi Thakur,

Can you try: 

overflow:hidden;  

-o-text-overflow:ellipsis;     

text-overflow:ellipsis;  

white-space:nowrap;

Best regard!

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.