Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cell shading in RTF documents

Tags:

rtf

Does anyone know the the rtf tags for applying a background color to a table cell?

I know the table structures:

{\rtf1\ansi\deff0
 \trowd
 \clshdng10000\cellx1000
 \clshdng10000\cellx2000
 \clshdng10000\cellx3000
 cell 1\intbl\cell
 cell 2\intbl\cell
 cell 3\intbl\cell
\row}

But i have no idea as to how to apply the shading.

UPDATED: i added cell shading, but still cant set the shade color

like image 282
stoic Avatar asked Jan 19 '23 16:01

stoic


1 Answers

I managed to get the solution:

{\rtf1\ansi\deff0
{\colortbl;\red188\green230\blue138;}<!--define a color table -->
  \trowd
  \cellx1000
  \clcbpat1\cellx2000 <!- \clcbpat1 = set background color -->
  \cellx3000
  cell 1\intbl\cell
  cell 2\intbl\cell
  cell 3\intbl\cell
 \row
}

You can string multiple colors together for example:

{\colortbl;\red188\green230\blue138;\red108\green030\blue038;}

And to use it you will call: \clcbpat1 or \clcbpat2

like image 134
stoic Avatar answered May 13 '23 11:05

stoic