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
Aron Schor [Dev]Aron Schor [Dev] 

Unnecessary "white/blank space" in Visual Force email template. How do I remove?

Hi,

I have a Visual Force template that shows items shipped and tracking information.
Each Sales Order has many Sales Order Lines.
 
Sales Order Lines are either Tracking or Products.
Products have a Line_Status__C that isn't null.
Tracking is on the Description field.  All other fields are null.
 
The template separates these, but it displays a blank section, almost like Tracking shows blank in the Products section and Products are blank in the Tracking section.  I have screen shots to illustrate.
 
Code is below.  Any idea here?  Thanks!  Not a developer here...

User-added image

Here is the second image.  Tracking is shown further below.
User-added image

<messaging:emailTemplate subject="{!relatedTo.Purchase_Order__c} Shipped" recipientType="User" relatedToType="Order_Header__c">
    <messaging:htmlEmailBody >
        <body style="font-family: 'Trebuchet MS'">
            <h4>
                Just letting you know Purchase Order - {!relatedTo.Purchase_Order__c},
                was shipped today.
            </h4>
            <hr style="border: solid thin #0099CC; margin-top: -18px;" />
 
            <br />
 
            <br />
 
            <table cellpadding="5" style="border-collapse: collapse" width="100%">
                <tr>
                    <td style="background-color: #0099CC; color: #FFFFFF">
                        <b>Stock Code</b>
                    </td>
                    <td style="background-color: #0099CC; color: #FFFFFF">
                        <b>Description</b>
                    </td>
                    <td style="background-color: #0099CC; color: #FFFFFF">
                        <b>Shipped Qty</b>
                    </td>
                    <td style="background-color: #0099CC; color: #FFFFFF">
                        <b>Status</b>
                    </td>
                </tr>
                <apex:repeat value="{!relatedTo.Order_Detail__r}" var="lineItem">
                    <tr style="display:{!IF(lineItem.Line_Status__c != null, '', 'none')}">
                        <td style="border-bottom: 1px solid #0099CC;">
                            <b>{!lineItem.Stock_Code__c}</b>
                        </td>
                        <td style="border-bottom: 1px solid #0099CC;">
                            {!lineItem.Description__c}
                        </td>
                        <td style="border-bottom: 1px solid #0099CC;">
                            {!lineItem.Shipped_Qty__c}
                        </td>
                        <td style="border-bottom: 1px solid #0099CC;">
                            {!lineItem.Line_Status__c}
                        </td>
                    </tr>
                </apex:repeat>
            </table>
 
            <br/>
 
            <h4>
                Tracking Code:
                <strong>
                    <apex:repeat value="{!relatedTo.Order_Detail__r}" var="lineItem">
                        <BR>{!IF(ISBLANK(lineItem.Stock_Code__c), lineItem.Description__c, NULL)}</BR>
                    </apex:repeat>
                </strong>
            </h4>
        </body>
    </messaging:htmlEmailBody>
</messaging:emailTemplate>