Re: Conditional Table Formatting
- To: mathgroup at smc.vnet.net
- Subject: [mg90651] Re: [mg90612] Conditional Table Formatting
- From: Gregory Lypny <gregory.lypny at videotron.ca>
- Date: Thu, 17 Jul 2008 05:37:20 -0400 (EDT)
- References: <200807161028.GAA08720@smc.vnet.net> <487E2C8C.40907@math.umass.edu>
Thanks Murray, Bob, Jean-Marc, and Daniel,
Good stuff. Very helpful because my results tables go on for days.
Regards,
Gregory
On Wed, Jul 16, 2008, at 1:14 PM, Murray Eisenberg wrote:
> Here's one way. (Undoubtedly there's a shorter, more elegant way to
> do this with pattern-matching.)
>
> data={{24,6,-6,0},{-6,-42,120,96},{-48,42,48,6}};
>
> bigRowEntryQ[row_]:=Or@@Thread[row>100]
> flagItem[x_]:=Style[x,FontColor->Red]
>
> Do[If[bigRowEntryQ[data[[i]]],data[[i]]=flagItem/@data[[i]]],{i,1,3}]
>
> data//TableForm
>
> The items in row 2 will now be red. Of course you would NOT now
> want to operate upon this table; for example, evaluating
>
> 2 data
>
> will give unwanted results.
>
> Gregory Lypny wrote:
>> Hello again,
>> Is there a way to make table formatting conditional the table's
>> values, for example, make a row red if the value in column 7 is
>> bigger than 100.
>> Regards,
>> Gregory
>
> --
> Murray Eisenberg murray at math.umass.edu
> Mathematics & Statistics Dept.
> Lederle Graduate Research Tower phone 413 549-1020 (H)
> University of Massachusetts 413 545-2859 (W)
> 710 North Pleasant Street fax 413 545-1801
> Amherst, MA 01003-9305
- References:
- Conditional Table Formatting
- From: Gregory Lypny <gregory.lypny@videotron.ca>
- Conditional Table Formatting