首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >HTML_ Ellipsis_ <td> <pre>

HTML_ Ellipsis_ <td> <pre>
EN

Stack Overflow用户
提问于 2013-10-01 08:35:48
回答 1查看 535关注 0票数 1

我对这件事非常好奇。

代码语言:javascript
复制
<table border="1">
<tr>
<th>header 1</th>
<th>header 2</th>
</tr>

<tr>
<td>
    <pre style="text-overflow:ellipsis; white-space:nowrap; overflow:hidden;">
           1. Lorem ipsum is simply dummy text of the printing
           2. and typesetting industry. 
           3. lorem ipsum has been the industry's standard dummy 
           4. text ever since
           5. the 1500s when an unknown printer took
           6. a galley of type and screambled it to make a type
           7. specimen book. it has survived not only five
    </pre>
    </td>
</tr>
</table>

取得结果(预期结果:<td>)

代码语言:javascript
复制
   1. Lorem ipsum is simply dummy text of the printing
   2. and typesetting industry. 
   3. lorem ipsum has been the industry's standard dummy 
   4. text ever since ...

但现在我的结果是

代码语言:javascript
复制
   1. Lorem ipsum is simply dummy text of the printing 2. and typesetting industry.3. lorem ipsum has been the industry's standard dummy 4. text ever since ...

为什么有关联?

在这种情况下,<td><pre>类是多行“省略”使用的障碍.那么我怎样才能克服这个问题呢?

环境: jquery-2.0.3。

ps。请除相关的“jqery.dotdotdot”插件外

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-10-02 00:35:06

问题在于white-space:nowrap;的CSS代码。这将覆盖预先格式化的文本。用这把小提琴检查一下。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19111526

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档