Due to the fact that there are lots of threads on this on SCN and also here where People are trying to find out how to Change font Color and font size conditionally, you will find a solution manipulating the CSS or the DOM via jQuery - thats not the way it is supposed to be.
I want to Show the way how to set this up, Controlling Color and font by the SAP backend!
Easy example, you are showing negative and positive values in an SAPUI5 table - lets say positive values:
You Need to more attributes in your entity, one for design and one for class:
Then you enhance your method in ABAP with the respective values (explained later in Detail which values are available):
and finally in UI5 table Definition a reference:
and there you go, highlighted one single row with a positive meaning (sorry for the black ... it is not meant for the public ;-) all other rows are not bold and not green)
Available Options in SAP: https://openui5.hana.ondemand.com/#docs/api/symbols/sap.ui.commons.TextViewDesign.html https://openui5.hana.ondemand.com/#docs/api/symbols/sap.ui.commons.TextViewColor.html
design
andsemanticColor
with their predefined values. But how about I would like to give a cell a red border#F00
, the cell's background color dimmed yellow#FF8
, and the text itself a bright purple#F0F
in Courier Bold? ;-) – Qualiture