Shading alternate table rows

Tables with alternating row colors.

The header row color is fixed.

The color of the first two data rows determine if alternating colours should be used and what the alternating pattern colors are.

Row coloring

The first row in the table is has the fill color set to GREY and it appears as GREY in the final document.This row has the fill color set to GREY and it always appears as GREY in the final document.

The repeating data starts from row two.

The first row in the table is a heading row and is outside the repeating data.

Row two contains <<rr_items>>. The color of this row will be used as the "alternate" color as the table expands.

The third row contains the first row of data items: <<$rownum>> and <<item>>The color of this row will be used as the color of the first data row in the final document..

If the row colors are different, then the shading of the remaining rows will alternate between these two colors.

Turning off alternate row coloring

This feature is triggered by configuring the first two data rows to have different colors, but this behaviour is not always desired.

The alternating row color feature can be disabled by including the filed <<noTableRowAlternate>> in the template.  The field can appear on a line by itself in which case the entire line is removed from the generated document.

When that field is included anywhere in the table, it disables the feature for table.

When that field is included in the body of the template, it disables the feature for all tables that appear after that field.

Built-in table variables

The <<$rownum>> variable is an example of a Docmosis built-in variable.

It is the number of the item in the repeating data set, so it doesn't include the header row, as you can see in this example. The $rownum variable starts from 1.

Try using <<$rowidx>>. This is another built-in variable that returns the number of the item in the repeating data set, starting from 0.

Feedback

Invalid Input

Sorry, this field will only accept letters and numbers, and not special characters, to limit spam. Please also consider contacting support@docmosis.com if you need help with this article.

Sorry, this field will only accept letters and numbers, and not special characters, to limit spam.

Invalid Input