设置最大块高度和修剪内容

发布于 2024-11-18 07:35:11 字数 1400 浏览 1 评论 0原文

我在 XSL-FO 文档中有一个表格,在单元格中有一个文章描述,它很容易溢出页面,所以我希望在单元格达到一定高度后将其剪切。这可能吗?这是我的例子,我尝试设置:

height="4cm"

block-dimension-progression.maximum="4cm"

它不起作用。

<fo:table-row keep-together.within-page="always"  height="2cm">
    <fo:table-cell border-right="1.5pt solid black">
        <fo:block text-align="center">
            <xsl:value-of select="count"/>
        </fo:block>
    </fo:table-cell>
    <fo:table-cell border-right="1.5pt solid black" padding-left="2pt">
        <fo:block>
            <xsl:value-of select="name"/>
        </fo:block>
        <fo:block font-size="10pt"><xsl:value-of select="manufacturer"/> / <xsl:value-of select="identifier"/></fo:block>
        <fo:block font-size="10pt"><xsl:value-of select="description"/></fo:block>
    </fo:table-cell>
    <fo:table-cell border-right="1.5pt solid black" padding-right="2pt">
        <fo:block text-align="right">
            <xsl:value-of select="unitprice"/>
        </fo:block>
    </fo:table-cell>
    <fo:table-cell>
        <fo:block text-align="right">
            <xsl:value-of select="totalprice"/>
        </fo:block>
    </fo:table-cell>
</fo:table-row>

I have a table in an XSL-FO document and in a cell there's an article description, which can easily overflow a page, so I want it to be just cut after reaching a certain height with the cell. Is that possible? This is my example, I tried setting:

height="4cm"

and

block-dimension-progression.maximum="4cm"

but it doesn't work.

<fo:table-row keep-together.within-page="always"  height="2cm">
    <fo:table-cell border-right="1.5pt solid black">
        <fo:block text-align="center">
            <xsl:value-of select="count"/>
        </fo:block>
    </fo:table-cell>
    <fo:table-cell border-right="1.5pt solid black" padding-left="2pt">
        <fo:block>
            <xsl:value-of select="name"/>
        </fo:block>
        <fo:block font-size="10pt"><xsl:value-of select="manufacturer"/> / <xsl:value-of select="identifier"/></fo:block>
        <fo:block font-size="10pt"><xsl:value-of select="description"/></fo:block>
    </fo:table-cell>
    <fo:table-cell border-right="1.5pt solid black" padding-right="2pt">
        <fo:block text-align="right">
            <xsl:value-of select="unitprice"/>
        </fo:block>
    </fo:table-cell>
    <fo:table-cell>
        <fo:block text-align="right">
            <xsl:value-of select="totalprice"/>
        </fo:block>
    </fo:table-cell>
</fo:table-row>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一页 2024-11-25 07:35:11

将带有文章描述的块放入块容器中,并设置 overflow="hidden" 和所需的高度。像这样:

<fo:block-container overflow="hidden" height="2cm">
 <fo:block font-size="10pt">Long description text goes here...</fo:block>
</fo:block-container>

Put the block with the article description in a block-container with overflow="hidden" and the desired height set. Like this:

<fo:block-container overflow="hidden" height="2cm">
 <fo:block font-size="10pt">Long description text goes here...</fo:block>
</fo:block-container>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文