如何确保更长的“跨度”?转到具有固定宽度的表格中的新行?
我有一张宽度固定的桌子。它的“tbody”是从 ajax 响应生成的。
我有一个我想要做的例子 http://jsfiddle.net/p5LL7/7/ <代码> 单击该按钮模拟 ajax 响应。您将看到第二个单词“panther”跳到下一行。如何确保:
- 包含较小单词的跨度显示在同一行(如表格的第二行),但
- 包含较长单词的跨度显示在下一行?
I have a table whose width is fixed. Its 'tbody' is generated from an ajax response.
I have an example of what I'm trying to do at http://jsfiddle.net/p5LL7/7/
Click on the button to simulate an ajax response.You will see that the second word i.e. "panther" breaks on to the next line. How do I make sure:
- Spans which contain smaller words are displayed on the same line(like the second row of the table) BUT
- Spans which contain longer words are displayed on the next line ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为跨度赋予
display: inline-block;
的 css 属性,然后它们应该自动换行。也失去断字属性。
Give the spans a css property of
display: inline-block;
and then they should just wrap automatically.Lose the break-word property also.