You need to sign in to do that
Don't have an account?
Zane Prater 15
How to Show/hide an html table in visualforce template
I have a template that pulls in related records from a vf component and want to hide when there are no records rather than showing an empty table.
<!---adding table-------> <table STYLE="{!IF(relatedto.Number_of_Lines__c == 0, 'display:none;','')}" type="text/css"> table { border-width: 0px; border-spacing: 5px; <!--border-style: solid; border-color: #FF0000;--> background-color: #b0b7bc; } td { text-align: center; color: #FFFFFF; border-width: 0px; padding: 0px; <!--border-style: solid; border-color: #000000;--> background-color: #013b59; } th { text-align: center; color: #FFFFFF; border-width: 0px ; padding: 4px ; border-style: none ; border-color: #000000; background-color: #013b59; } </table> <font face="arial" size="2"> <table border="50"> <td><c:ReturnCRItems cse_id="{!relatedTo.id}"></c:ReturnCRItems></td> </table></font>
You should be able to control the rendering of the row using <apex:variable>:
For more detail refer this :-
https://salesforce.stackexchange.com/questions/11554/hide-the-whole-empty-row-of-table-in-vf-page-when-rendered-as-pdf
Please mark it as best answer if it helps you.
Regards,
Priya Ranjan