Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #6012 > unrolled thread

Re: Strings with different Styles in a Grid

Started byBob Hanlon <hanlonr357@gmail.com>
First post2011-10-29 11:27 +0000
Last post2011-10-29 11:27 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Strings with different Styles in a Grid Bob Hanlon <hanlonr357@gmail.com> - 2011-10-29 11:27 +0000

#6012 — Re: Strings with different Styles in a Grid

FromBob Hanlon <hanlonr357@gmail.com>
Date2011-10-29 11:27 +0000
SubjectRe: Strings with different Styles in a Grid
Message-ID<j8gnui$5ia$1@smc.vnet.net>
Grid[{{Style["aa", Red, Bold], Style["bb", Green]},
  {Row[{Style["c", Blue, Bold], Style["c", Red]}], "dd"}}]


Bob Hanlon


On Fri, Oct 28, 2011 at 5:35 AM, Don <donabc@comcast.net> wrote:
> Here is a Grid of strings, with some strings having different styles.
>
> Grid[{{Style["aa", Red, Bold], Style["bb", Green]}, {"cc", "dd"}}]
>
> The "cc" string should be output with the first "c" in the color Blue and
> in Bold, the second "c" should be in the color Red.
>
> How does one "break apart" the "cc" string to give each "c" a different style
> while still maintaining it as a single item for the Grid function?
>
> Something like this, which is very intuitive, simply doesn't work
>
> Grid[{{Style["aa", Red, Bold], Style["bb", Green]},
>  {{Style["c", Blue, Bold], Style["c", Red]}, "dd"}}]
>
>
> And this, doesn't work either  ...
>
> Grid[{{Style["aa", Red, Bold], Style["bb", Green]},
>  {StringJoin[Style["c", Blue, Bold], Style["c", Red]], "dd"}}]
>
> Thank you in advance.
>
> Don

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web