Things that help in Advanced pdf or html templates creation.

(1)  

It is Nonbreaking space.
It’s used to create a space that will not break into a new line by word wrap.
Provide space as same as a regular space.

eg: <p>Text&nbsp;Text</p>

Output will be like: Text Text

Inside a table we can use &nbsp; inside <td></td> tags to add a blank row.

If the table has 3 column we can write the code like this.

eg:<tr><td rowspan="1" colspan="3">&nbsp;</td></tr>

This will provide a blank row inside a table.
By using &nbsp;  we can add required spacing in required place while creating an
Advanced pdf or html templates.

(2) To get current date and current time in printing template.
   <tr>
   <td>Printed on: ${.now?date}<br />${.now?time}</td>
   </tr>
(3) Print date based on a condition: if shipdate exist, print shipdate. 
    If no shipdate then, print current date.
<tr>
<td>Ship Date: <#if record.shipdate?has_content>${record.shipdate} <#else>${.now?date} </#if>
</td>
</tr>

Leave a comment

Your email address will not be published. Required fields are marked *