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

"word-wrap:break-word" doesn't work when generating PDF with SpraedPDFBundle

我正在尝试在 <td> 中拆分文本。我尝试了一些 poroposed 解决方案,但似乎 none 有效。

Possible Duplicate: Word-wrap

我要破个大link。这是我的代码:

<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>

现在这是我的 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