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