Adding Striping to Line Items in Advanced Templates

You can edit HTML markup source in the template editor to add striping to the line items table in an advanced template.

The syntax for adding striping to the line items tables relies on BFO (Big Faceless Organization), a set of third party libraries used by NetSuite for generating PDF documents. BFO documentation is available at http://bfo.com/products/report/docs/userguide.pdf.

Note:

If you are having issues with your advanced template, do not contact BFO directly. Always contact NetSuite Customer Support.

Warning:

Do not modify markup source directly unless you have sufficient CSS and HTML knowledge. NetSuite does not provide support or training in CSS or HTML.

Be aware that the template editor may not function properly if you switch back to WYSIWYG mode after edits have occurred in markup source mode. Some template content may not be represented correctly, may not be accessible for editing, or may not be displayed at all.

If these issues occur, you can preserve template content by not saving the template in WYSIWYG mode and switching back to markup source mode.

You can look up hex codes in the HTML color picker provided in the template editor.

To add striping to a line items table:

  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.
    Note:

    You should avoid using the <tbody> tag. BFO processing issues can result in an inability to save a template that includes this element.

  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.

To get hexadecimal codes for striping colors:

  1. In rich text editing mode, click the text color or background color button.

    Color buttons
  2. Click More Colors.

    Select color window
  3. In the Select Color window, click a color to see the hex code.

    Select color window

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.

Related Topics

Source Code Editing in the Template Editor
Source Code Editing to Customize Advanced Templates
Syntax for Advanced Template Fields
Setting a Template to Use a Font Unavailable in NetSuite
Languages for Printed Forms that Use Advanced Templates
Adding Translated Content in Advanced Printouts
Adding Page Breaks to Tables
Printing Subsidiary Logo on Advanced Templates
Adding Apply Sublist to Check Templates
Using FreeMarker to Work with Hidden Fields Used in Advanced Templates
Adding Bar Codes in Advanced Templates

General Notices