171
Views
6
Comments
Solved
How to fix the table column width?

Hi, I’m having some trouble with fixing the table column width and was hoping for some guidance.

The "Subject Name" column has a long text that goes beyond the boundary. I've tried the following:

  • Wrapping the table in a container and adding overflow-x: auto;
  • Setting the table width to 100%
  • Assigning width: 30% to each column

But it’s still not working as expected. Do you have any suggestions on how to fix this?


Thanks!

2026-02-26 06-29-24
Rahul
 
MVP
Solution

Hi @Rajanha Kumar ,

use this class CSS on the expression or table column.  

.wrap{

  • width: 85px;
  • display: inline-block;
  • white-space: pre-wrap;      /* CSS3 */    
  • white-space: -moz-pre-wrap; /* Firefox */       
  • white-space: -pre-wrap;     /* Opera <7 */     
  • white-space: -o-pre-wrap;   /* Opera 7 */       
  • word-wrap: break-word;      /* IE */
  • word-wrap: break-word;

}


this will work and break a word without space as well.


Regards

Rahul


2020-11-25 10-45-32
Mostafa Othman
Champion

Hello,

Did you tried to set width of Row cell (column) as following:

UserImage.jpg
Rajanha Kumar

Hi @Mostafa Othman, yup, i set width of each Row cell, but still not work well

UserImage.jpg
Rajanha Kumar

It works, my testing record should not use the single long word without any space, thank you Mostafa.

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

Hi @Rajanha Kumar,

We have two scenarios:

First is that as per your screenshot we have only one word that is long that much without space basically we don't have that much long single word. But if we have we can do word-wrap.

word-wrap is one of the CSS property which defined in the below link how it works:

https://www.w3schools.com/cssref/tryit.php?filename=trycss3_word-wrap

Second is that if we have sentence which long and going out of the box so you can see below CSS property link:

https://www.w3schools.com/cssref/playdemo.php?filename=playcss_white-space&preval=pre-wrap


Hope this will helps you!!

Regards,

Rajat

UserImage.jpg
Rajanha Kumar

Thank you Rajat, it works!

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