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
DevelopementDevelopement 

VF template formatting issue

Hi All,

I am using a VF template for email alerts. One of the field on the template is rich tex area. So far the template works fine. But sometimes if the Rich text area has data in the table format that mess up the VF template. VF template adjust as per the data size and formatting is messed up. How can I fix it?

I don't want table column to get adjust as per the data. 
Thanks
shashi lad 4shashi lad 4
You can use html formatting ie. <table> <tr><td> and it will work fine. 

- shashi
DevelopementDevelopement
<messaging:emailTemplate subject="{!$Label.CurrencyFormat}" >
<messaging:htmlEmailBody >
<html>
<style>
a {
color: #0028a0;
}
.emailheader {
font-family: Arial, Helvetica, sans-serif;
font-size: 22px;
color: #0028a0;
}
.emailauthor {
font-family: arial, sans-serif;
font-size: 11px;
color: #555555;
}
.emailintro {
font-family: arial, sans-serif;
font-size: 15px;
color: #959595;
}
.emailsubhead {
font-family: arial, sans-serif;
font-size: 15px;
font-weight: bold;
line-height: 20px;
color: #0028a0;
padding-bottom: 5px;
}
.emailbullet {
font-family: arial, sans-serif;
font-size: 12px;
font-weight: bold;
color: #009ddb;
}
.emailcopy {
font-family: arial, sans-serif;
font-size: 12px;
line-height: 15px;
color: #555555;

}
.emailsmall {
font-family: arial, sans-serif;
font-size: 11px;
line-height: 15px;
color: #555555;
}
.emailsmall p {
margin-top: 0px;
margin-bottom: 12px;
}
.emaillink {
color: #009ddb;
}
</style>

<body>
<table width="650" border="0" align="center" cellpadding="0" cellspacing="0" >
  <tr>
    <td colspan="3"><img src="http://v3.eci.com/sites/products/MarketingAttachments/mis_debrief_header.jpg"  width="650" height="88" border="0"/></td>
  </tr>
  <tr>
    <td width="1" bgcolor="#747679"><img src="http://www.eci.com/sites/products/MarketingAttachments/mco_invday/s.gif" width="1" height="1"/></td>
    <td width="648" valign="top"><table width="648" cellspacing="0" cellpadding="0" border="0">
      <tr>
        <td height="35" colspan="4"></td>
      </tr>
      <tr>
        <td width="39"></td>

        <td width="571" class="emailheader">{!$label.EmailTemp_Members}


          <table width="100%" border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td height="15"></td>
            </tr>
            
            
            <tr>
              <td height="125" valign="top" class="emailcopy">
               <apex:outputText value="{!$Label.Lev1_Header}" escape="false" />&nbsp;{!relatedto.account.name} <br/>
                <apex:outputText value="{!$Label.Equivalent}" escape="false" /> {!$Label.CurrencyFormat}<apex:outputField value="{!relatedto.Amount_USD__c}"></apex:outputField> <br/>
                (<apex:outputText value="{!$Label.currency}" escape="false" /> &nbsp;<apex:outputField value="{!relatedto.Total_Amount__c}"></apex:outputField>&nbsp;{!relatedto.CurrencyIsoCode})<br/><br/>
<apex:outputText value="{!SUBSTITUTE($Label.EPAC_Header,'OwnerEmail',relatedto.owner.email)}" escape="false" /> 
                 <br/>
                 <apex:outputText value="{!SUBSTITUTE($Label.EmailTemp_Header_Remain,'OwnerName',relatedto.Owner.name)}" escape="false"/> 
<br/><br/>
  
                      <table border="1" cellpadding="2" cellspacing="0"  style="border-collapse: collapse;table-layout: fixed" bordercolor="#C0C0C0" width="100%" >
                                                    
                                                   <tr>
                                                         <td width="37%" valign="top"  class="emailcopy">{!$label.EmailTemp_Contact}</td>
                                                         <td width="63%" align="left" valign="top" class="emailcopy"><a href="mailto:{!relatedto.owner.email}">{!relatedto.owner.name}</a></td>
                                                </tr>
                                         
                                                <tr>
                                                         <td valign="top"  class="emailcopy">{!$ObjectType.case.fields.Recrd__c.label}:</td>
                                                         <td valign="top"  class="emailcopy"  align="left"><apex:outputText escape="false" value="{!relatedto.Record__c}"></apex:outputText></td>
                                                </tr>
                                                <tr>
                                                         <td valign="top" class="emailcopy">{!$label.EmailTemp_LinkToEntry}</td>
                                                         <td valign="top" class="emailcopy" align="left"><a href="{!LEFT($Api.Partner_Server_URL_260, FIND(".com/",$Api.Partner_Server_URL_260)+3)}/{!relatedto.Id}">{!LEFT($Api.Partner_Server_URL_260, FIND(".com/",$Api.Partner_Server_URL_260)+3)}/{!relatedto.Id}</a></td>
                                                </tr>
                                  </table><br/><br/>

                </td>
            </tr>
          </table></td>
        <td width="38"></td>
      </tr>
      <tr>
        <td height="35" colspan="3"></td>
      </tr>
    </table></td>
    <td width="1" bgcolor="#747679"><img src="http://www.eci.com/sites/products/MarketingAttachments/mco_invday/s.gif" width="1" height="1"/></td>
  </tr>
  <tr>
        <td width="650" height="21" colspan="3">
                <img src="http://www.eci.com/sites/products/MarketingAttachments/mis_cfg-general/CFG_footer.gif" alt="" width="650" height="21" border="0"/><br />
        </td>
</tr>
</table>
</body>
</html>
</messaging:htmlEmailBody>
</messaging:emailTemplate>