You need to sign in to do that
Don't have an account?
jojoforce
How to slds-truncate within an HTML Table
Essentially, the task subject or the Account Name should be truncated when its too long but here is what is happening in my component. Any advice on how to use the sdls-truncate css?
<table class="slds-table slds-no-row-hover"> <tbody> <aura:iteration items="{! v.tasks }" var="task"> <tr class="slds-hint-parent"> <td class="slds-text-align_left" style="width:30px;"> <lightning:input type="checkbox" label="Checkbox Label" variant="label-hidden"></lightning:input> </td> <td class="slds-text-align_left"> <div class="slds-grid slds-truncate_container_33" > <span class="slds-truncate" title="{!task.Subject}"> <a target="_blank" class="slds-text-link" href="" onclick="{! c.handleTaskLink }" data-taskid="{!task.Id}"> {!task.Subject} </a> </span> </div> </td> <td class="slds-text-align_right"> <div class="slds-grid" > <span class="slds-truncate" title="{!task.Account.Name}"> <a target="_blank" class="slds-text-link" href="" onclick="{! c.handleAccountLink }" data-accountid="{!task.AccountId}"> {!task.Account.Name} </a> </span> </div> </td> </tr> </aura:iteration> </tbody> </table>
Can you try using the same class on <a> tag like this:
<a target="_blank" class="slds-truncate slds-text-link" href="" onclick="{! c.handleAccountLink }" data-accountid="{!task.AccountId}">
Thanks,
Abhishek Bansal.
As mentioned in the below link
>> https://developer.salesforce.com/forums/?id=9062I000000g3u1QAA
Can you see if it works if you try the below code:
<p class="slds-truncate" title=" {!task.Account.Name} "> {!task.Account.Name} </p>
I hope this helps and in case if this comes handy can you please choose this as best answer so that it can be useful for others in the future.
Regards,
Anutej
Gmail: abhibansal2790@gmail.com
Skype: abhishek.bansal2790