Adding Striping to Line Items in Advanced Templates

1.Open the advanced template in the template editor, and click the Source Code toggle.

2.Scroll down to the portion of the HTML markup source relating to the rows in the line items table:

Advanced PDF/HTML Templates sample code for adding striping to a line items table.

3.Edit the <tr> tag relating to rows in the line items table, to specify alternating colors for these rows, like the following example:

<tr style="background-color: ${((item_index % 2)==0)?string('#ffffff', '#ccffcc')};">

In this example, even rows use the color represented in hexadecimal by #ffffff and odd rows use the color represented by #ccffcc.

Advanced PDF/HTML Templates code example for adding color to even rows of a table.

To get hexadecimal codes for striping colors, you can look up hex codes in the HTML color picker provided in the template editor.

For example, you want your printed purchase orders to include borders and striping.

Edit the template markup source to add the table styles.

Advanced PDF/HTML Templates example borders and striping code.A purchase order that uses the table styles shown will display striping and dotted borders.

Advanced PDF/HTML Templates sample Purchase Order showing striping and dotted borders.

Leave a comment

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