'XSL Table indents not aligning vertically

I'm trying to enable some sort of containership inside my Table by indenting parameters owned by other params. I have an example here. Table showing containership of parameters. The issue I'm having is the left column isn't aligning and the logic to handle this below must be wrong. I have another example here of parameters with misaligned table columns. misaligned columns.

I'm guessing this logic to handle table columns is not applying correctly.

<fo:table width="{6.5 - ($indentLevel * $indentWidth)}in">
                <fo:table-column width="{$descWidth - ($indentLevel * $indentWidth)}in" />
                <fo:table-column width="{$valueWidth}in" />

Or maybe I need to add some XSL to a

<fo:table-cell number-columns-spanned="2" >

The full XSL template is below.

<xsl:template match="bml:Parameter[bml:Parameter]">
        <xsl:param name="indentLevel" select="number(0)" />
        <xsl:variable name="headingSize" select="14 - $indentLevel" />
        
        <xsl:variable name="descWidth">3.5</xsl:variable>
        <xsl:variable name="valueWidth">3</xsl:variable>
        <xsl:variable name="indentWidth">0.25</xsl:variable

        <!-- add some padding columns for indentation -->
        <fo:table width="{6.5 - ($indentLevel * $indentWidth)}in">
            <fo:table-column width="{$descWidth - ($indentLevel * $indentWidth)}in" />
            <fo:table-column width="{$valueWidth}in" />
            <fo:table-header>
                <fo:table-row>
                    <fo:table-cell number-columns-spanned="2" >
                        <fo:block font-weight="bold" font-size="{$headingSize}pt">
                            <xsl:choose>
                                <xsl:when test="bml:Description"><xsl:value-of select="bml:Description" /></xsl:when>
                                <xsl:otherwise><xsl:value-of select="bml:ID"/></xsl:otherwise>
                            </xsl:choose>
                        </fo:block>
                    </fo:table-cell>
                </fo:table-row>
            </fo:table-header>
            <fo:table-body>
                <xsl:for-each select="bml:Parameter[not(bml:ParameterSubType='NoReport')]">
                    <xsl:choose>
                        <xsl:when test="./bml:Parameter">
                            <fo:table-row>
                                <fo:table-cell number-columns-spanned="2" padding-left="{$indentWidth}in">
                                    <xsl:apply-templates select=".">
                                        <xsl:with-param name="indentLevel" select="$indentLevel + 1"/>
                                    </xsl:apply-templates>
                                </fo:table-cell>
                            </fo:table-row>
                        </xsl:when>
                        <xsl:otherwise>
                            <xsl:apply-templates select="." />
                        </xsl:otherwise>
                    </xsl:choose>
                </xsl:for-each>
            </fo:table-body>
        </fo:table>
    </xsl:template>


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source