Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

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

Search the Archive

Re: Conditional Table Formatting

  • To: mathgroup at smc.vnet.net
  • Subject: [mg90633] Re: Conditional Table Formatting
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
  • Date: Thu, 17 Jul 2008 05:33:52 -0400 (EDT)
  • Organization: The Open University, Milton Keynes, UK
  • References: <g5kiil$8ik$1@smc.vnet.net>

Gregory Lypny wrote:

> 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.

Hi Gregory,

Depending on what you mean by -- or use for -- "table formating", 
various options are possible. Below I illustrate only two of them.


     arr = Array[(#1 #2)^2 &, {5, 4}];
     If[#[[3]] > 100, Style[#, Red, Bold], #] & /@ arr


     itstl = ItemStyle -> {Automatic,
        Thread[Flatten[Position[arr, _List?(#[[3]] > 100 &)]] -> Red]}
     Grid[arr, itstl]


Best regards,
-- Jean-Marc


  • Prev by Date: Using manipulate with PlotDensities
  • Next by Date: Re: Solve[] doesn't
  • Previous by thread: Re: Conditional Table Formatting
  • Next by thread: ShowGraph without vertex coordinates normalized