如何确保更长的“跨度”?转到具有固定宽度的表格中的新行?

发布于 2025-01-04 06:27:07 字数 302 浏览 3 评论 0原文

我有一张宽度固定的桌子。它的“tbody”是从 ajax 响应生成的。

我有一个我想要做的例子 http://jsfiddle.net/p5LL7/7/ <代码> 单击该按钮模拟 ajax 响应。您将看到第二个单词“panther”跳到下一行。如何确保:

  1. 包含较小单词的跨度显示在同一行(如表格的第二行),但
  2. 包含较长单词的跨度显示在下一行?

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:

  1. Spans which contain smaller words are displayed on the same line(like the second row of the table) BUT
  2. Spans which contain longer words are displayed on the next line ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

﹏雨一样淡蓝的深情 2025-01-11 06:27:07

为跨度赋予 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.

一袭水袖舞倾城 2025-01-11 06:27:07
.mngAppSpan{
  float:left;
  ..
  .
}
.mngAppSpan{
  float:left;
  ..
  .
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文