首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >XSL FO如何防止检索标记生成换行?

XSL FO如何防止检索标记生成换行?
EN

Stack Overflow用户
提问于 2018-03-29 16:25:53
回答 1查看 128关注 0票数 1

我使用表格来格式化表格标题。

当表格标题很短并且会在一行中显示时,"retrieve-marker“会生成不需要的换行符。当标题长达一行,并且在标题内生成换行时,"retrieve-marker“不生成换行。

当表格标题很短(只有几个单词)时,有可能防止换行吗?

它应该看起来像这样:

代码语言:javascript
复制
-------------------------------------
|Table 1   | Picture XYZ (continued)|
-------------------------------------

-----------------------------------------------------------------------------------------
|Table 1343   | Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy|
|             | eirmod tempor invidunt ut labore et dolore magna aliquyam (continued)   |
-----------------------------------------------------------------------------------------

It should not look like:
------------------------------
|Table 1   | Picture         | 
|          | XYZ (continued) |
------------------------------

我当前的XSL-FO代码:

代码语言:javascript
复制
<fo:table table-layout="auto" inline-progression-dimension="auto">
    <fo:table-footer>
        <fo:table-row>
            <fo:table-cell>
                <fo:block>
                    <fo:inline white-space-treatment="ignore" keep-together.within-line="always">
                        <xsl:value-of select="$table_title"/>&#160;
                        <xsl:choose>
                            <xsl:when test="$chapter_number = 0"/>
                            <xsl:when test="$chapter_number = 1">
                                <fo:retrieve-marker retrieve-class-name="KapitelEbene1" retrieve-position="first-including-carryover" retrieve-boundary="page-sequence"/><xsl:number count="//content/pmentry" level="any" format="1"/><xsl:value-of select="$chapter_number_seperator"/>
                            </xsl:when>
                        </xsl:choose>
                        <xsl:call-template name="nummerierung_tabelle"/>
                        <xsl:text>&#160;&#160;&#160;</xsl:text>
                    </fo:inline>
                </fo:block>
            </fo:table-cell>
            <fo:table-cell>
                <fo:block>
                    <xsl:value-of select="ancestor::table/title"/>&#160;<fo:retrieve-marker retrieve-class-name="TableContinued" retrieve-position="last-ending-within-page" retrieve-boundary-within-table="page"/>
                </fo:block>
            </fo:table-cell>
        </fo:table-row>
    </fo:table-footer>
</fo:table>
EN

回答 1

Stack Overflow用户

发布于 2018-03-29 17:13:43

&#160;不是空格。您不允许格式化程序在(continued)之前换行,因此当它将(continued)放在下一行时,它必须将前面的单词拖到下一行(至少部分)。

我不清楚为什么格式化程序要将短标题放在两行上,但请尝试指定表列的宽度,以便包含标题的列适当地宽。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49551274

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档