Skip to main content
Question

Hi All - anyone know if you can dynamically change font colour in the XMLTemplator within a <td style..> tag using an FME attribute ?

  • September 14, 2020
  • 2 replies
  • 38 views

Something like this (it does't seem to like this) :

 

<td style="color:" {fme:get-attribute("StoragePreviousWeekStartFontColour")} ";padding: 1px 1px 0px 1px; white-space:pre-wrap; word-wrap:break-word; border: 1px solid #d4d4d4">

 

{fme:get-attribute("Storage Mon 31 Aug")}

 

</td>

2 replies

jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • September 14, 2020

Is the colour supposed to be in quotation marks? I normally see inline styles like <p style="color:green; font-size:18px;"> Also a semi-colon at the end of style.


  • Author
  • September 15, 2020

Thanks jdh, it got me thinking. I made the mistake of assuming I'd need to differentiate / escape / evaluate between a value in an FME attribute and an attribute in a css html tag - it didn't require this in the end - so this worked:

 

<td style="color: {fme:get-attribute("StorageChange_WWFontColour")};padding: 1px 1px 0px 1px; white-space:pre-wrap; word-wrap:break-word; border: 1px solid #d4d4d4">

 

{fme:get-attribute("Change_WW")}

 

</td>


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings