起步软件技术论坛
搜索
 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 5273|回复: 6

[结贴] 文本换行

[复制链接]

59

主题

163

帖子

555

积分

高级会员

Rank: 4

积分
555
QQ
发表于 2017-8-24 10:04:57 | 显示全部楼层 |阅读模式
版本: 其它(帖子中说明) 小版本号: 7
数据库: MySQL 服务器操作系统: Windows 应用服务器: Tomcat
客户端操作系统: Windows 7 浏览器: IE7
版本3.7 .grid组件里的某列存储css样式,因为过长,会自动换行。参照http://docs.wex5.com/bex5-ui-question-list-10098/
写的Model.prototype.grid1CellRender = function(event) {
                if (event.colName == "q_naire_guide" && event.colVal != undefined) {//判断是不是需要换行显示的这列并且列是有值的
                        event.html = "<div style='word-wrap:normal; white-space:nowrap;'>" + event.colVal + "</div>";//在div中显示列的值event.colVal
                }
        };
此时,纯文本不换行,但是css样式会自动渲染出来,还是有换行的效果。
<p style="line-height: 1.5em;">    <span style="color: rgb(31, 73, 125); font-size: 16px; font-family: 微软雅黑, &#39;Microsoft YaHei&#39;;"><br/></span></p><p style="line-height: 1.5em;">    <span style="color: rgb(0, 112, 192); font-size: 16px; font-family: 微软雅黑, &#39;Microsoft YaHei&#39;;"><br/></span></p><p style="line-height: 1.75em;">    <strong><span style="color: rgb(0, 112, 192); font-size: 16px; font-family: 微软雅黑, &#39;Microsoft YaHei&#39;;">文本文本文本文本文本文本文本文本文本文本:</span></strong></p><p style="line-height: 1.75em;">    <strong><span style="color: rgb(0, 112, 192); font-size: 16px; font-family: 微软雅黑, &#39;Microsoft YaHei&#39;;">&nbsp; &nbsp; &nbsp文本文本文本文本文本文本文本文本文本文本</span></strong>
</p><p style="line-height: 1.75em;">    <strong><span style="color: rgb(0, 112, 192); font-size: 16px; font-family: 微软雅黑, &#39;Microsoft YaHei&#39;;">&nbsp; &nbsp; &nbsp;文本文本文本文本文本文本文本文本文本文本<span style="color: rgb(255, 0, 0); font-size: 16px; font-family: 微软雅黑, &#39;Microsoft YaHei&#39;;">2017年05月04日 18:00-2017年05月07日 23:59</span>,文本文本文本文本文本文本文本文本文本文本。</span></strong></p><p style="line-height: 1.75em;">    <strong><span style="color: rgb(0, 112, 192); font-size: 16px; font-family: 微软雅黑, &#39;Microsoft YaHei&#39;;">&nbsp; &nbsp; &nbsp;文本文本文本文本文本文本文本文本文本文本</span></strong></p><p>    <br/></p><p style="text-align: right; line-height: 1.75em;">    <strong><span style="color: rgb(0, 112, 192); font-size: 16px; font-family: 微软雅黑, &#39;Microsoft YaHei&#39;;"><span style="color: rgb(0, 112, 192); font-size: 16px; font-family: 微软雅黑, &#39;Microsoft YaHei&#39;;"><span style="font-size: 16px; font-family: 微软雅黑, &#39;Microsoft YaHei&#39;; line-height: 24px; text-align: center;">文本文本文本文本文本文本文本文本文本文本 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span>&nbsp; &nbsp;</span></strong></p><p style="line-height: 1.75em; text-align: right;">    <strong><span style="color: rgb(0, 112, 192); font-size: 16px; font-family: 微软雅黑, &#39;Microsoft YaHei&#39;;">&nbsp;文本文本文本文本文本文本文本文本文本文本 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span></strong><span style="color: rgb(0, 176, 240); font-size: 16px; font-family: 微软雅黑, &#39;Microsoft YaHei&#39;;"><br/></span></p><p style="text-align: right; line-height: 1.75em;">    <span style="color: rgb(0, 176, 240); font-size: 16px; font-family: 微软雅黑, &#39;Microsoft YaHei&#39;;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span></p><p>    <br/></p><p>    <br/></p><p style="display: none;">    <br/></p>

91

主题

13万

帖子

3万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
36187
发表于 2017-8-24 10:36:50 | 显示全部楼层
具体要的是换行还不换行?数据库中存的是什么数据?
远程的联系方法QQ1392416607,添加好友时,需在备注里注明其论坛名字及ID,公司等信息
发远程时同时也发一下帖子地址,方便了解要解决的问题  WeX5教程  WeX5下载



如按照该方法解决,请及时跟帖,便于版主结贴
回复 支持 反对

使用道具 举报

59

主题

163

帖子

555

积分

高级会员

Rank: 4

积分
555
QQ
 楼主| 发表于 2017-8-24 11:17:06 | 显示全部楼层
jishuang 发表于 2017-8-24 10:36
具体要的是换行还不换行?数据库中存的是什么数据?

想要的是不换行,具体存的就是下面的那段代码<p style ......>
回复 支持 反对

使用道具 举报

91

主题

13万

帖子

3万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
36187
发表于 2017-8-24 13:24:41 | 显示全部楼层
默认就是不换行的,你参考的链接是实现换行的
远程的联系方法QQ1392416607,添加好友时,需在备注里注明其论坛名字及ID,公司等信息
发远程时同时也发一下帖子地址,方便了解要解决的问题  WeX5教程  WeX5下载



如按照该方法解决,请及时跟帖,便于版主结贴
回复 支持 反对

使用道具 举报

59

主题

163

帖子

555

积分

高级会员

Rank: 4

积分
555
QQ
 楼主| 发表于 2017-8-24 17:28:23 | 显示全部楼层
jishuang 发表于 2017-8-24 13:24
默认就是不换行的,你参考的链接是实现换行的

默认是不换行的,但是文本里有回车键,会换行的。
回复 支持 反对

使用道具 举报

91

主题

13万

帖子

3万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
36187
发表于 2017-8-24 17:33:50 | 显示全部楼层
这不是平台可以控制的,可以到网上查找div中显示内容有回车控制强制不换行怎么设置
远程的联系方法QQ1392416607,添加好友时,需在备注里注明其论坛名字及ID,公司等信息
发远程时同时也发一下帖子地址,方便了解要解决的问题  WeX5教程  WeX5下载



如按照该方法解决,请及时跟帖,便于版主结贴
回复 支持 反对

使用道具 举报

59

主题

163

帖子

555

积分

高级会员

Rank: 4

积分
555
QQ
 楼主| 发表于 2017-8-24 17:39:59 | 显示全部楼层
jishuang 发表于 2017-8-24 17:33
这不是平台可以控制的,可以到网上查找div中显示内容有回车控制强制不换行怎么设置 ...

结贴吧
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|X3技术论坛|Justep Inc.    

GMT+8, 2025-7-21 17:43 , Processed in 1.827727 second(s), 30 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表