See "Color in a table based on values" for a method that allows you to colorize cells based on the contents. This works in simple and advanced XML.
You may want to take this a step further and colorize a cell based on the value of a previous cell. This is useful when you want a to stylize a cell according to something on the server (but not based solely on the contents of one cell). This technique would allow you to stylize a cell based on a value pulled in from a lookup.
For example, you could include a column called dest_class in your view and then use this column to indicate how the dest column ought to be stylized. You can do this via CSS once you are using the application.js specified in the other Splunk-Base answer above:
Define CSS to stylize the column next to the dest_class column
This CSS will style the cell in the column just after the "dest_class" column if "dest_class" is set to "internal":
.splView-YOUR_VIEW_NAME .SimpleResultsTable tr td.d[data-value="internal"][field="dest_class"] + td
{
color: #C42323;
font-weight: bold;
}
This should be placed in $SPLUNK_HOME/etc/apps/YOUR_APP/appserver/static/application.css.
Defined CSS to hide the dest_class column
There is a good chance that may want to hide the column that you are using to stylize the other column. You can do this with a little CSS. Note that this examples assumes that the column you want to hide is the 8th column (modify per your view):
.splView-YOUR_VIEW_NAME .SimpleResultsTable tr td:nth-of-type(8),
.splView-YOUR_VIEW_NAME .SimpleResultsTable tr th:nth-of-type(8){
display:none;
}
See https://github.com/LukeMurphey/splunk-website-monitoring/blob/master/src/appserver/static/application.css for an example of application.css where this techique is being used.
... View more