0

Description

After carrying out some computation and establishing a set of data, I would like to tablularise data and highlight values which do not meet acceptable treshold.

A similar question has been asked here. However, after trying to apply answer left by @kglr, specifically option 1, I ran into an error message. See example below.

Example

Code

Grid[Item[#, Background -> If[# < 50, Red]] & /@ # & /@ RandomInteger[{1, 100}, {17, 5}]]

Output

output example

Error

The specified setting for the option ItemBoxOptions, Background cannot be used.

How could I avoid the error message and highlight values which do not meet acceptable treshold?

OS Win 7 x64
Mathematica V10.3

e.doroskevic
  • 5,959
  • 1
  • 13
  • 32

1 Answers1

4

I think the error is because when #>50, there is nothing chosen for Background (i.e., it sees Background->Null and so complains that Null isn't a valid option). Try:

Grid[Item[#, Background -> If[# < 50, Red, White]] & /@ # & /@ 
             RandomInteger[{1, 100}, {17, 5}]]
bill s
  • 68,936
  • 4
  • 101
  • 191