4.2. Giving a background color to table cells Previous topic Parent topic Child topic Next topic

This chapter explains how you can give a background color to table cells by adding a bgcolor(color) directive to the @outputclass attribute of most table elements.

It's possible to give a background color to table cells by adding a bgcolor(color) directive, where color is any CSS color value, to the @outputclass attribute of the following elements:
Inside a <simpletable> element
<simpletable>, <sthead>, <strow>, <stentry>.
Inside a <table> element
<tgroup>, <thead>, <tbody>, <row>, <entry>.
Example:
<table>
  <tgroup cols="2" outputclass="bgcolor(#F0FFFF)">
    <tbody>
      <row>
        <entry>C1,1</entry>
        <entry>C1,2</entry>
      </row>
      <row outputclass="bgcolor(#FFFFF0)">
        <entry>C2,1</entry>
        <entry>C2,2</entry>
      </row>
    </tbody>
  </tgroup>
</table>
Note that it is still possible to specify any class name you want in the @outputclass attribute of a table element. Example: <simpletable outputclass="bgcolor(#FFFFF0) fancy-table">.