Why is truncate not working in Lightning component?

Why is truncate not working in Lightning component?

I am not able to truncate a long text area field {! consult.Situation__c } when displayed in a Lightning component:

What is lightning formatted rich text in JavaScript?

A lightning-formatted-rich-text component is a read-only representation of rich text. Rich text refers to text that’s formatted by HTML tags, such as for bold text or for underlined text. You can pass in rich text to this component using the lightning-input-rich-text component or programmatically in JavaScript.

How to pass in HTML tags in Lightning?

To pass in HTML tags in your component markup, escape the tags like this. The component sanitizes HTML tags passed to the value attribute to prevent XSS vulnerabilities. It also ensures that the formatted output is valid HTML. For example, if you have mismatched tags like My Title , the component returns My Title .

Where can I find the Salesforce Lightning Component Library?

Government Data Track Healthcare Data Track B-Well Together Leading Through Change Salesforce Care AppExchange Resources MuleSoft Resources Login › Sign Up › My Developer Account > Create Account > My Settings > Admin Site > CMS >

Why does SLDs-cell-shrink not work with table?

I just looked at your example. You removed the slds-truncate class which means (since it’s a table) that it stretches the cell. Leave the slds-cell-shrink on the th and put the slds-truncate class back on the td and it works.

Where do I put the truncation class in SLDs?

If problems occur when using truncation with elements that use flexbox, you might need to add the .slds-has-flexi-truncate class on the flexbox child node ( .slds-col or .slds-col_padded elements) that contains the truncated text. Long text field with many lines and truncation will look like this. Even though the text might go on for ages and ages.

Why is HTML table SLDs not working properly?

I am facing the exact same issue but not able to resolve. I have tried applying the slds classes just as you did but the styling does not appear. Can you show how you have used the lightningStyleSheets and apex:slds tags in your scenario?