在 XSL 生成的 FO 文档中的 table 中挣扎一些边距
Struggling with some margin in a table in XSL generated FO document
祝大家节日快乐!
我目前正在研究从 DocBook 到 apache fo(然后继续到 PDF)的 XSLT 转换,但我正在努力处理一个 table。
这是我的样式表的相关部分。
<fo:block>
<fo:table border-style="none" border-width="0pt">
<fo:table-column column-width="20%"/>
<fo:table-column column-width="80%"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell border-style="solid" border-width="1pt" text-align="start" padding-left="0cm">
<fo:block font-weight="bold">First Column <xsl:text> </xsl:text> <xsl:number level="multiple" count="d:appnote" format="1"/>
</fo:block>
</fo:table-cell>
<fo:table-cell border-style="solid" border-width="1pt" text-align="start">
<fo:block><xsl:value-of select="d:description" /></fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:block>
不幸的是,结果 table 在 table 的左边框和文本的开头之间显示了一些相当大的边距(即使我设置了 padding-left="0cm")
我尝试了很多不同的属性和选项,但我无法摆脱这个空白。
有人可以给我提示吗?
start-indent
属性 被设置它的元素的后代 FO 元素 继承,这有时会导致一些违反直觉的结果.
由于显然不是所有的实现都以相同的方式运行,FOP 的站点有一个特定的 FAQ 条目:When I use margins, my content in a nested table or block-containers gets indented twice. Is this a bug?
因此,在您的情况下,table 单元格的内容很可能继承了祖先元素(即使是非常遥远的元素)上的 start-indent
集。
如果是这种情况,您可以在 fo:table-body
到 "reset" 上添加一个 start-indent="0pt"
属性到 0。
祝大家节日快乐!
我目前正在研究从 DocBook 到 apache fo(然后继续到 PDF)的 XSLT 转换,但我正在努力处理一个 table。
这是我的样式表的相关部分。
<fo:block>
<fo:table border-style="none" border-width="0pt">
<fo:table-column column-width="20%"/>
<fo:table-column column-width="80%"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell border-style="solid" border-width="1pt" text-align="start" padding-left="0cm">
<fo:block font-weight="bold">First Column <xsl:text> </xsl:text> <xsl:number level="multiple" count="d:appnote" format="1"/>
</fo:block>
</fo:table-cell>
<fo:table-cell border-style="solid" border-width="1pt" text-align="start">
<fo:block><xsl:value-of select="d:description" /></fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:block>
不幸的是,结果 table 在 table 的左边框和文本的开头之间显示了一些相当大的边距(即使我设置了 padding-left="0cm")
我尝试了很多不同的属性和选项,但我无法摆脱这个空白。
有人可以给我提示吗?
start-indent
属性 被设置它的元素的后代 FO 元素 继承,这有时会导致一些违反直觉的结果.
由于显然不是所有的实现都以相同的方式运行,FOP 的站点有一个特定的 FAQ 条目:When I use margins, my content in a nested table or block-containers gets indented twice. Is this a bug?
因此,在您的情况下,table 单元格的内容很可能继承了祖先元素(即使是非常遥远的元素)上的 start-indent
集。
如果是这种情况,您可以在 fo:table-body
到 "reset" 上添加一个 start-indent="0pt"
属性到 0。