You need to sign in to do that
Don't have an account?
ArmanM
Align text issue
Hi,
How can I align the following to the left of the page, its a pdf.
I want to shift all the text to the left with this formet, here is the section of code for this-
Please help out. Thank you !
How can I align the following to the left of the page, its a pdf.
I want to shift all the text to the left with this formet, here is the section of code for this-
<tr> <td colspan="4"> </td> </tr> <tr> <td colspan="4" style="font-weight: bold; border-bottom-style: solid; border-bottom-width: thick; border-bottom-color: #30b55a;"> Campaign Information </td> </tr> <tr> <td style="color: #808080; border-right-style: solid; border-right-width: thin; border-right-color: #30b55a;"> Campaign Name </td> <td align="left"> {!Opportunity.Name} </td> </tr> <tr> <td align="right" style="color: #808080; border-right-style: solid; border-right-width: thin; border-right-color: #30b55a;"> Brand </td> <td style="text-align:left"> {!Opportunity.Account.Name} </td> </tr> <tr> <td align="right" style="color: #808080; border-right-style: solid; border-right-width: thin; border-right-color: #30b55a;"> Start Date </td> <td style="font-weight: normal"> <apex:outputText value="{0,date,MM'/'dd'/'yyyy}"> <apex:param value="{!Opportunity.Campaign_Start_Date__c}" /> </apex:outputText> </td> </tr> <tr> <td align="right" style="color: #808080; border-right-style: solid; border-right-width: thin; border-right-color: #30b55a;"> End Date </td> <td style="font-weight: normal"> <apex:outputText value="{0,date,MM'/'dd'/'yyyy}"> <apex:param value="{!Opportunity.Campaign_End_Date__c}" /> </apex:outputText> </td> </tr> <tr> <td align="right" style="color: #808080; border-right-style: solid; border-right-width: thin; border-right-color: #30b55a;"> Duration </td> <td style="font-weight: normal"> <apex:outputText value="{0,number,0}"> <apex:param value="{!Opportunity.Campaign_Duration__c}"/> </apex:outputText> </td> </tr>
Please help out. Thank you !
I would also recommend reviewing field sets [1] and they may help simplify your code.
[1] http://blog.deadlypenguin.com/blog/2016/04/25/field-sets-dynamic-visualforce/
All Answers
So switching it to align="left" works for me
There may be some other CSS that is affecting your tables. Can you provide the entire page? Personally I don't think it's anything but the align="left". If you look at your "Campaign Name" field, it's aligned to the left and it is missing the align attribute on your td. When the attribute is missing, it defaults to left.
I would also recommend reviewing field sets [1] and they may help simplify your code.
[1] http://blog.deadlypenguin.com/blog/2016/04/25/field-sets-dynamic-visualforce/