9

Suppose I have an xsl:fo block:

<fo:block>one two three</fo:block>

Can I make "three" a different color than "one" and "two"? Note: I'd rather NOT use a table for this.

Mads Hansen
  • 63,927
  • 12
  • 112
  • 147
Ya.
  • 1,671
  • 4
  • 27
  • 53

1 Answers1

18

You can us an <fo:inline> element.

The fo:inline formatting object is commonly used for formatting a portion of text with a background or enclosing it in a border.

For example, in order to make the word "three" red:

<fo:block>one two <fo:inline color="#FF0000">three</fo:inline></fo:block>
Mads Hansen
  • 63,927
  • 12
  • 112
  • 147
  • I need something similar like this but not with text; only square boxes with background color only. I gave a background-color, but without content that's not working. How can I do that? – Mahesh May 27 '21 at 14:01
  • Create a question and post a minimal example of your xsl-fo – Mads Hansen May 27 '21 at 14:06
  • https://stackoverflow.com/questions/67724887/xsl-fo-empty-inline-block-with-background-color – Mahesh May 27 '21 at 15:10