Xslt 如果较长,则在第二列上方换行的类似表格的输出
所以我试图解决的当前用例如下 我有一个两列的表,在某些情况下(当第一列足够长时),它需要在打断第二行之前与第二列重叠,然后第二列条目右对齐并位于第二行Xslt 如果较长,则在第二列上方换行的类似表格的输出,xslt,formatting,xsl-fo,Xslt,Formatting,Xsl Fo,所以我试图解决的当前用例如下 我有一个两列的表,在某些情况下(当第一列足够长时),它需要在打断第二行之前与第二列重叠,然后第二列条目右对齐并位于第二行 | Column A | Column B | ----------------------- |Case one | Case one| ----------------------- |Case two where the | |line breaks| Case two| 我面临的问题是,我应该如何对其进行格式化以获得所需的结
| Column A | Column B |
-----------------------
|Case one | Case one|
-----------------------
|Case two where the |
|line breaks| Case two|
我面临的问题是,我应该如何对其进行格式化以获得所需的结果。我尝试过很多东西,但都有不足之处,可能是在考虑浮动,但我以前很少使用它们。如果有其他方法可以实现这一点,我不喜欢使用表格 您可以使用
fo:leader
和fo:inline container
来编写文本,但我不确定如何在不使某些边框重叠的情况下编写“表格单元格”的边框:
<fo:block>Case one<fo:leader leader-length.minimum="0"
leader-length.optimum="100%" keep-with-previous.within-line="always"
keep-with-next.within-line="always" /><fo:inline-container
width="50%"><fo:block text-align="right">Case
one</fo:block></fo:inline-container></fo:block>
<fo:block>Case two where the line breaks<fo:leader
leader-length.minimum="0" leader-length.optimum="100%"
keep-with-previous.within-line="always"
keep-with-next.within-line="always" /><fo:inline-container
width="50%"><fo:block text-align="right">Case
two</fo:block></fo:inline-container></fo:block>
案例一案例
一
第二种情况是线路断开
二
表格单元格上没有边框,因此这不是问题,您可以尝试一下解决方案,看看效果如何。
<fo:block>Case one<fo:leader leader-length.minimum="0"
leader-length.optimum="100%" keep-with-previous.within-line="always"
keep-with-next.within-line="always" /><fo:inline-container
width="50%"><fo:block text-align="right">Case
one</fo:block></fo:inline-container></fo:block>
<fo:block>Case two where the line breaks<fo:leader
leader-length.minimum="0" leader-length.optimum="100%"
keep-with-previous.within-line="always"
keep-with-next.within-line="always" /><fo:inline-container
width="50%"><fo:block text-align="right">Case
two</fo:block></fo:inline-container></fo:block>