Skip to main content
1 of 2

Conditional formatting of `Table` with `Join` and `Transpose`

A simple example of what I'm trying to do (but I want to be able to apply the same principle to much larger data sets and with more complicated functions for low and high):

data = {1, 5, 6, 9, 13, 20, 67, 68, 80, 97}; 
xList = Range[10]; 
low = (#1^1.9 & ) /@ xList; 
high = (#1^2.1 & ) /@ xList; 
table = Transpose[Join[{xList, low, data, high}, 2]]; 
TableForm[table]

I want to apply a conditional Style to data:

If[low < data < high, Style[data, Green], Style[data, Red]]

Easy in principle - but everything I have tried results in error messages and strings of data that aren't in TableForm.

How do I do it?