Category: Widget
Resource links
Updated

Dynamically Align Text in a Table Widget Column

Issue

 If you want to align the text displayed in a particular column of a Table widget to the left or to the right based on the value of the same or a different column, this article explains how to do it. 

In this example, one of the fields returned by the query populating a Table widget is direction and can have either the value incoming or outgoing

Resolution

  1. Click on the gear icon next to the column for which you dynamically want to align the text.
  2. Go to the Style properties.
  3. Click the JS icon next to the Text align property and enter the following snippet:

    {{currentRow.direction === “incoming” ? 'LEFT' : 'RIGHT'}}