Technology has always been a bridge, but today, it feels more like a mirror. With the rapid rise of AI , we are seeing things enter our lives and leave them at a pace we can barely track. To understand where this is going, we first have to understand how technology actually impacts the core of who we are. The Survivalist vs. The Ego Our minds are biologically wired for one thing: survival . We are designed to handle the worst-case scenario, an ancient instinct gifted to us by nature. We consider ourselves conscious decision-makers, but a critical question remains: Who is really making the call?
Here I am going to show you, How to insert formatted data (table, colorful text etc) in rich text area field salesforce. We can directly use updated rich text area in our email templates without doing any extra code for email template.
Here is sample code.
Below code is for table:-
string table ='<p><span style=\"color: #2e6c80;\"><strong>Table Heading</strong></span>
</p>\r\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"font-size:12px;\">\r\n<tbody>';
table+=createColumn('table column ame 1','Table column Value 1');
table+=createColumn('Your column Name 2','table column value 2');
public static string createColumn(string column,string value){
return '<tr>\r\n<td>'+column+'</td>\r\n<td tabindex=\"0\">\r\n<div>'+value+'</div>\r\n</td>\r\n</tr>';
}
Here is sample code.
//Heading for rich text area content.
string body='<h3 style=\"color: #2e6c80;\">your heading :</h3>\n
<ol style=\"list-style: none; font-size: 12px; line-height: 32px; \">\n';
body += '<li style=\"clear: both;\"><b>'+Your Label Name+' : </b> '+
yourValue.replaceAll(';',' , ') +'</li>';
body +='</ol>';
yourRichTextAreaField=body;
Below code is for table:-
string table ='<p><span style=\"color: #2e6c80;\"><strong>Table Heading</strong></span>
</p>\r\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"font-size:12px;\">\r\n<tbody>';
table+=createColumn('table column ame 1','Table column Value 1');
table+=createColumn('Your column Name 2','table column value 2');
table+='</tbody>\r\n</table>';public static string createColumn(string column,string value){
return '<tr>\r\n<td>'+column+'</td>\r\n<td tabindex=\"0\">\r\n<div>'+value+'</div>\r\n</td>\r\n</tr>';
}