MathGroup Archive 2003

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: color in GridBox

  • To: mathgroup at smc.vnet.net
  • Subject: [mg45316] Re: [mg45243] color in GridBox
  • From: Omega Consulting <info at omegaconsultinggroup.com>
  • Date: Tue, 30 Dec 2003 04:14:22 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

At 04:13 AM 12/23/2003, merkat wrote:
>I have a GridBox of 9 numbers.
>how do I set the Background-color  of all numbers > 5 to red?
>
>
>Table[Random[Integer, 9], {9}];
>Partition[%, 3];
>DisplayForm[GridBox[%]]

color[x_] := Module[{str},
     str = ToString[x];
     If[x > 5, StyleForm[str, Background -> RGBColor[1, 0, 0]], str]
     ]

t = Table[color[Random[Integer, 9]], {3}, {3}];
DisplayForm[GridBox[t]]

--------------------------------------------------------------
Omega Consulting
"The final answer to your Mathematica needs"
http://omegaconsultinggroup.com


  • Prev by Date: Re: Mathematica + NETLink + CodeDom- Example 2
  • Next by Date: Re: On MS-Windows -- Calling MS-DOS Applications from Mathematica
  • Previous by thread: color in GridBox
  • Next by thread: Bug in Integrate? (v. 5.0)