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
- Click on the gear icon next to the column for which you dynamically want to align the text.
- Go to the Style properties.
-
Click the JS icon next to the Text align property and enter the following snippet:
{{currentRow.direction === “incoming” ? 'LEFT' : 'RIGHT'}}