Knowledge Drop

Conditional formatting (font size, color) in a table viz

  • 5 April 2021
  • 0 replies

Userlevel 5
  • Looker Staff
  • 171 replies

Last tested: March 2021


There are currently options for font size in the table-next visualization.

As of 4.10, we have conditional formatting that can be used in the table visualization. As of 5.2, this can be applied on a per-measure basis. This only affects colors, not font size.

Size customization can be achieved with html in LookML, as in this article:

 dimension: status {  sql: ${TABLE}.status ;;  html: {% if value == 'Paid' %}  <p style="color: black; background-color: lightblue; font-size:100%; text-align:center">{{ rendered_value }}</p>  {% elsif value == 'Shipped' %}  <p style="color: black; background-color: lightgreen; font-size:100%; text-align:center">{{ rendered_value }}</p>  {% else %}  <p style="color: black; background-color: orange; font-size:100%; text-align:center">{{ rendered_value }}</p>  {% endif %};; }


This content is subject to limited support.                

0 replies

Be the first to reply!