Announcement

Collapse
No announcement yet.

How do I color a cell red in Ultra status?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How do I color a cell red in Ultra status?

    I would like one of my cells containing alarm info in my ultra status page be either red or green, depending upon the alarm state. Can this be done?

  • #2
    Do an If/Then to check the alarm state. Something like...
    <pre class="ip-ubbcode-code-pre">AlarmState = hs.DeviceStatus("a1")
    If AlarmState = "On" Then
    AlarmColor = "green"
    Else
    AlarmColor = "red"
    End If</pre>

    Then, in the table definition set the cell color to equal the value you got above.
    <pre class="ip-ubbcode-code-pre">&lt;td bgcolor=""" & AlarmColor & """&gt;</pre>

    You can get more efficient and setup the colors in a style in STYLE.CSS and just apply that style to the &lt;td&gt;. This will allow easy changes if you decide on a different solor scheme in the future.

    Comment

    Working...
    X