在< td>中换行标签 [英] Wrap text in <td> tag
本文介绍了在< td>中换行标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想包装一些添加到<td>
元素的文本.
我已经尝试过style="word-wrap: break-word;" width="15%"
.
但这不是包装文字.是否必须提供100%的宽度?
我还有其他控件要显示,因此只有15%的宽度可用.
I want to wrap some text that is added to a <td>
element.
I have tried with style="word-wrap: break-word;" width="15%"
.
But it is not wrapping the text. Is it mandatory to give it 100% width?
I have other controls to display so only 15% width is available.
推荐答案
包装TD文本
首先设置表格样式
table{
table-layout: fixed;
}
然后设置TD样式
td{
word-wrap:break-word
}
这篇关于在< td>中换行标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文