The custom styles used to fill the table cells in XML can be applied in two ways – on Paragraph or on Characters. However, when these are used, the cells are not filled completely.

The custom styles look like the following image:

However, there is a better approach in filling a common color to all the cells of a table. You need to edit the td tag in the DocToHelp’s Style list Tags Collection. The following are the steps for the same:

  1. Open your source.xml in D2H XML editor.
  2. Click on Editor>Style list.
  3. Look for Tags in the style list.
  4. Expand it and select the “td” tag and Modify it.
  5. Putting your color & customizations into it would reflect in all tables.

In case you want to set a different color to a particular cell, you need to go to the Source tab of the XML document and edit the style tag explicitly for that cell as:

<td style="BACKGROUND: green;">
<p>Table cell value</p>
</td>

The modified output will look like the following:

You may refer to the attached sample for complete implementation.
Download Sample

Tags: , , ,