Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2007

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

Search the Archive

Re: Coloring cells


Hi Jamie,

Take a look at tutorial/FormattedOutput in online Help,

An example is given there which is very close to what you wanted:-


Grid[Partition[
   Table[If[PrimeQ[i], Item[i, Background -> LightYellow], i], {i, 1,  
100}],
   10], Background -> LightBlue]

It is almost always true that there is a straightforward way of doing  
what you want (particularly now in V6) but finding it
is not always easy.

HTH


Yours truly ... Syd

Syd Geraghty B.Sc., M.Sc.
sydgeraghty at mac.com
San Jose, CA

My System

Mathematic 6.0.1 for Mac OS X x86 (32 - bit) (June 19, 2007)  License  
L2983-5890
MacOS X V 10.4 .10
MacBook Pro 2.33 Ghz Intel Core 2 Duo  2GB RAM

On Nov 23, 2007, at 5:33 AM, Jamie Coventry wrote:

> Hi All,
>
> I'm presenting data in a square arrangement and am trying to
> highlight specific cells in it which have something in common, e.g.
> all are prime, or all are odd numbers. I don't mind if the data is in
> an array/matrix/table, as long as it is n x n.
>
> myData = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
>
> How do I either color the text or the background of a particular
> cell, based on a rule (e.g. how could I color just 2, 3, 5, and 7 in
> the data given)?
>
> Thanks in advance,
>
> Jamie
>
>



  • Prev by Date: Re: Button[label, action] Change Font?
  • Next by Date: Re: Button[label, action] Change Font?
  • Previous by thread: Coloring cells
  • Next by thread: Re: Coloring cells