我正试图打破 <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/