html显示长数据的处理方法
2013-07-04 16:18
363 查看
在html中显示长度较大的数据时,可以将数据截取显示,当鼠标滑过时再显示完整数据。
例如,下面这种情况。
实现:
<a title="${siteBoardInfoList.boardUrl}">
<c:if test="${fn:length(siteBoardInfoList.boardUrl) >= 40}">
${fn:substring(siteBoardInfoList.boardUrl,0,20)}......${fn:substring(siteBoardInfoList.boardUrl,fn:length(siteBoardInfoList.boardUrl)-21,fn:length(siteBoardInfoList.boardUrl))}
</c:if>
<c:if test="${fn:length(siteBoardInfoList.boardUrl) < 40}">
${siteBoardInfoList.boardUrl}
</c:if>
</a>
例如,下面这种情况。
实现:
<a title="${siteBoardInfoList.boardUrl}">
<c:if test="${fn:length(siteBoardInfoList.boardUrl) >= 40}">
${fn:substring(siteBoardInfoList.boardUrl,0,20)}......${fn:substring(siteBoardInfoList.boardUrl,fn:length(siteBoardInfoList.boardUrl)-21,fn:length(siteBoardInfoList.boardUrl))}
</c:if>
<c:if test="${fn:length(siteBoardInfoList.boardUrl) < 40}">
${siteBoardInfoList.boardUrl}
</c:if>
</a>
相关文章推荐
- html显示长度较大的数据时的处理方法
- 树形数据的反选有两种方法以及处理后台返回拼装htmL的异步获取不到现象(但是页面F12可以看到)
- Java后台处理带HTML标签数据的方法 -------------Java搬砖之路(1)
- spring mvc 4.x 版本在返回给ajax调用的json数据时候,出现中文显示???的处理方法
- 利用Ajax生成ProgressBar:实现同类大批量数据批量生成Html,并实时显示进度条,可查看处理日志
- Ajax处理XML、HTML、JSON三种数据格式的方法
- 数据列表显示字符过长处理方法
- 复杂检索数据并分页显示的处理方法
- PHP里面把16进制的图片数据显示在html的img标签上(实现方法)
- 后台传过来的JSON数据里的date传到前台的时候显示的是【Object object】 处理方法
- html中文显示乱码的处理方法
- 爬虫 Http请求,urllib2获取数据,第三方库requests获取数据,BeautifulSoup处理数据,使用Chrome浏览器开发者工具显示检查网页源代码,json模块的dumps,loads,dump,load方法介绍
- document.execCommand()方法处理Html数据
- Flexigrid在IE下不显示数据的处理的解决方法
- ajax提交含有html数据时的处理方法
- 复杂检索数据并分页显示的处理方法
- Flexigrid在IE下不显示数据的有效处理方法
- 复杂检索数据并分页显示的处理方法
- PHP复杂检索数据并分页显示的处理方法
- Flexigrid在IE下不显示数据的处理的解决方法