MathGroup Archive 2008

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

Search the Archive

Re: Conditional Table Formatting


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