Search code examples
xsl-foapache-fop

Index a block-container below the table-cell


A background coloured block-container text overlaps the square rounded table-cell as you can see

enter image description here

i want to avoid hacks like a block-container with the same height as the table cell with only upper left corner rounded and such. Just z index the block-container below the table-cell

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="3.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:fo="http://www.w3.org/1999/XSL/Format"
    xmlns:exsl="http://exslt.org/common"
    xmlns:java="http://xml.apache.org/xslt/java"
    exclude-result-prefixes="java"
    xmlns:map="xalan://java.util.HashMap" extension-element-prefixes="map"
    xmlns:fox="http://xmlgraphics.apache.org/fop/extensions">


    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
        font-family="fira-sans">


        <fo:layout-master-set>
            <fo:simple-page-master
                master-name="A4landscape" margin-right="0.5cm" margin-left="0.5cm"
                margin-bottom="1cm" margin-top="1cm">
                <fo:region-body></fo:region-body>
            </fo:simple-page-master>
        </fo:layout-master-set>
        <fo:page-sequence master-reference="A4landscape">
            <fo:flow flow-name="xsl-region-body">
                <fo:wrapper font-size="4pt" font-family="fira-sans">
                        <fo:table border-collapse="separate" border-color="black"
                    fox:border-radius="0.2cm" border-style="solid"
                    border-width="0.2mm" table-layout="fixed" width="100%"
                    font-size="8pt" >
                    <fo:table-column column-width="4cm" />
                    <fo:table-column column-width="4.5cm" />
                    <fo:table-column column-width="3.5cm" />
                    <fo:table-column column-width="3.5cm" />
                    <fo:table-column />
                    <fo:table-body font-weight="normal" font-size="8pt">
                        <fo:table-row line-height="10pt">
                            <fo:table-cell background-color="#D3DCE9"
                                border-right-color="black" border-right-width="0.5pt"
                                border-right-style="solid">
                                <fo:block
                                    color="black" font-size="8pt" font-family="fira-sans-bold">
                                    test-me
                                </fo:block>
                            </fo:table-cell>
                        </fo:table-row>
                    </fo:table-body>
                </fo:table>
                </fo:wrapper>
            </fo:flow>

        </fo:page-sequence>
    </fo:root>
    </xsl:stylesheet>

Solution

  • I don't use FOP, but can you either use fox:border-before-start-radius on the fo:table-cell or specify both that and the background on the fo:block?