C:\DITA\WKFS_oXygen_Files\fragments\webhelp.fragment.head.xml
Jump to main content C:\DITA\WKFS_oXygen_Files\fragments\webhelp.fragment.before.body.xml

# Customizing the Header, Rows, and Borders within a Table

Enter topic summary (Optional) - remove all text if not used

You can customize the header, rows, and borders within a table through the use of a custom stylesheet. After configuring the custom stylesheet, you can now specify table shading through the TableStyle option.
Note: The font-size specified for the table styles below is what will actually be used. Normally adjustments are performed on certain fonts to make them larger than specified if the font does not meet legal size requirements but that adjustment will not be done for custom tables.

1. Within the `Custom_WKFS_Styleguide.xsl` file, navigate to the `Tables` section. Within each `style <x> table` section modify the following:
   - `style<x>-header-attrs` - font, color, background color, font weight, font style, text decoration, and font size variables for the table header.
   - `style<x>-body-attrs` - font size, color, and font family variables for the table rows.
   - `style<x>-border-attrs` - border size, style, and width variables for the table borders.

       <!-- Begin options for style1 table -->
       	<xsl:attribute-set name="style1-header-attrs">
       	 <xsl:attribute name="font-family">Times New Roman</xsl:attribute>
       	 <xsl:attribute name="color">blue</xsl:attribute>
       	 <xsl:attribute name="background-color">pink</xsl:attribute>
       	 <xsl:attribute name="font-weight">normal</xsl:attribute>
       	 <xsl:attribute name="font-style">italic</xsl:attribute>
       	 <xsl:attribute name="text-decoration">underline</xsl:attribute>
       	 <xsl:attribute name="font-size">16pt</xsl:attribute>
       	</xsl:attribute-set>

       	<xsl:attribute-set name="style1-body-attrs">
       	 <xsl:attribute name="font-size">13pt</xsl:attribute>
       	 <xsl:attribute name="color">purple</xsl:attribute>
       	 <xsl:attribute name="font-family">Comic</xsl:attribute>
       	</xsl:attribute-set>

       	<xsl:template name="style1-border-attrs">
       	 <xsl:attribute name="border-color">red</xsl:attribute>
       	 <xsl:attribute name="border-style">dotted</xsl:attribute>
       	 <xsl:attribute name="border-width">1.25pt</xsl:attribute>
       	</xsl:template>

       	<xsl:variable name="style1-TableBodyEvenRowBackgroundColor" select="'green'" />
       	<xsl:variable name="style1-TableBodyOddRowBackgroundColor" select="'yellow'" />
       	<!-- End options for style1 table -->

2. Save the changes.
3. Within the Requirements Editor, create a table. On the Table element, right-click and select Add Attribute/TableStyle.
4. Within the TableStyle attribute, double-click No Value and select the desired Style (as created in the `Custom_WKFS_Styleguide.xsl` file). Return to the .xsl file to make any further updates to a particular TableStyle style.
   Note: The particular TableStyle selection will override other attributes selected elsewhere in the table element: font, weight, color, etc.

C:\DITA\WKFS_oXygen_Files\fragments\webhelp.fragment.after.body.xml