function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Shilpa KambleShilpa Kamble 

Display Rich Text field value with proper alignment in table

How do I display Rich Text Area field value with proper alignment in table in lightning component.
Description column displaying data of 'Rich Text area' field

Thanks
Best Answer chosen by Shilpa Kamble
sfdcMonkey.comsfdcMonkey.com
hi Shilpa
try this onces
                    <div class="uiOutputRichText">       
						<ui:outputRichText value="{!res.ezeetrack__Description__c}"/>
					</div>
Let me inform if it work and mark it best answer if it helps you so it make proper solution for others
Thanks
 

All Answers

Shilpa KambleShilpa Kamble
here is the code,

<table class="slds-table slds-table--bordered slds-max-medium-table--stacked" role="grid" > 
	<thead>
		<tr class="slds-text-title--caps">
			 <aura:if isTrue="{!v.isSObjNotResourceType}">
				 <th class="slds-truncate" scope="col"><span><b>Image</b></span></th>
			</aura:if>
			<th class="slds-truncate slds-max-medium-table--stacked" scope="col" aria-label="Name"><span ><b>Name</b></span></th>
			<th class="slds-truncate slds-max-medium-table--stacked" scope="col"><span ><b>Description</b></span></th>
			<aura:if isTrue="{!v.isSObjNotResourceType}">
				<th class="slds-truncate slds-max-medium-table--stacked" scope="col"><span ><b>Action</b></span></th>
			</aura:if>
		</tr>
	</thead>
	<tbody>
		<aura:iteration items="{!v.resultList}" var="res">
			<tr>
				<aura:if isTrue="{!v.isSObjNotResourceType}">
					<td>
						 <img src="{!'/servlet/servlet.FileDownload?file='+v.attchid}"/>
					</td>
				</aura:if>
				<td>
					<aura:if isTrue="{!!v.isSObjNotResourceType}">
						<a href="#"><span onclick="{!c.GetListOfchildRecords}" data-index="{!res.Id}">{!res.Name}</span></a> 
					<aura:set attribute="else">
						{!res.Name}
					</aura:set>
					</aura:if>
					</td>
				<td >
                    <!-- Displaying data from RichTextArea field -->
					<div class="uiOutputRichText">       
						<span>{!res.ezeetrack__Description__c}</span>
					</div>
					
				</td>
				<aura:if isTrue="{!v.isSObjNotResourceType}">
					<td >
						<button class="slds-button slds-button--neutral slds-not-selected" aria-live="assertive" type="button" onclick="{!c.ViewDetailsOfRecord}" id="{!res.Id}">View Details</button>&nbsp;&nbsp; 
						<button class="slds-button slds-button--neutral slds-not-selected" aria-live="assertive" type="button" onclick="{!c.BookResource}" id="{!res.Id}">Book</button>
					</td>
				</aura:if>
			</tr>
		</aura:iteration>
	</tbody>
</table>

I made the RichTextArea field code in Bold & Italic. Please check!
sfdcMonkey.comsfdcMonkey.com
hi Shilpa
try this onces
                    <div class="uiOutputRichText">       
						<ui:outputRichText value="{!res.ezeetrack__Description__c}"/>
					</div>
Let me inform if it work and mark it best answer if it helps you so it make proper solution for others
Thanks
 
This was selected as the best answer
Shilpa KambleShilpa Kamble
Thanks Piyush,
It is working.