html - "word-wrap:break-word"在使用 SpraedPDFBundle 生成 PDF 时不起作用

标签 html css symfony pdf twig

我正试图打破 <td> 中的文本.我尝试了一些解决方案,但似乎没有一个有效。

Possible Duplicate: Word-wrap

我想断开一个大链接。这是我的代码:

<div style="padding-top: 250px;  margin-right: 25px;">
        <table style="table-layout:fixed; width:700px;">
            <col width="300">
            <col width="10">
            <col width="10">
            <col width="10">
            <col width="10">
            <thead>
                <tr>
                    <th class="desc">Link</th>
                    <th class="unit">Price</th>
                    <th class="qty">Amount</th>
                    <th class="service">TVA</th>
                    <th class="total">TOTAL</th>
                </tr>
            </thead>
            <tbody>
                    <tr>
                        <td class="desc" style="overflow:hidden; word-wrap: break-word;
                            word-break: break-all;">Link</td>
                        <td >price</td>
                        <td >amount</td>
                        {% if oProd.tva %}
                            <td>tva%</td>
                        {% else %}
                            <td>TVA non existante</td>
                        {% endif%}
                        <td>inal_price</td>
                        {% set total = total + final_price%}
                    </tr>
                {% endfor %}
            </tbody>
            <tfoot>
                <tr>
                    <td colspan="2"></td>
                    <td colspan="2">Prix final</td>
                    <td>{{ total }}</td>
                </tr>
            </tfoot>
        </table>
    </div>

现在这是我的 desc CSS:

    .service .desc h4 {
    font-size: 22px;
    line-height: 25px;
}
.service .desc {
    padding: 0 15px;
    overflow: hidden;
}
table .desc {
    text-align: left;
    background: #D0D0D0;
}

最佳答案

@Besbes Riadh 我发布的代码将使 word-wrap: break-word 适用于不同的浏览器不同版本的 CSS。它可以添加到 CSS 的末尾。 Explanation and source

关于html - "word-wrap:break-word"在使用 SpraedPDFBundle 生成 PDF 时不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31502463/

相关文章:

javascript - 表单时隐藏元素(菜单选择选项为空)

html - IE 无法显示 html 背景图像(颜色正常)

jQuery 隐藏在 .post 成功函数中不起作用

javascript - 对空值和数字进行排序以模仿 tabindex HTML 属性功能

html - 工具提示因溢出而中断 : Hidden Parent

symfony - Heroku 可信代理

php - 我怎样才能制作一个按钮链接,就像在 Facebook 中一样?

css - 隐藏图像的底部 20px,必要时缩小

javascript - 强制页面预加载器出现在任何内容之前

symfony - 如何在自定义symfony表单字段类型中默认使用empty_value选项?