New Batch#100 (10th Nov 2021) - Salesforce Admin + Dev Training (WhatsApp: +91 - 8087988044) :https://t.co/p4F3oeQagK

Friday 9 June 2017

Displaying text in td cell in multiple lines Salesforce

TD text value in multiple lines -


<apex:page > <apex:form> <table> <tr><td>     <div id="myDiv"/>     </td></tr>     </table>        <apex:commandButton onclick="myFunction();" value="NextLine" reRender="dummy"/>     <apex:outputPanel id="dummy"/>     </apex:form>     <script>         function myFunction() {             document.getElementById('myDiv').innerHTML='<apex:outputText escape="false" value="{!$Label.sample}"/>';             //$Label.sample -->This is <strong><font color="#FF0000"></font></strong> Test Label111 <br/> second Line             alert('hi');         }     </script> </apex:page>

Result:

Labels