随笔-193  评论-715  文章-1  trackbacks-0
@import url(http://www.blogjava.net/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css); 1、表格中的内容过长时,不换行,显示省略号并Tooltip。
1<table width="200px" style="border:1px solid #000000;table-layout:fixed;word-wrap:break-word;word-break:break-all;"> 
2    <tr>
3    <td  style="font-size: 11px;text-overflow:ellipsis;overflow:hidden;white-space: nowrap;">
4    dfasdfdsf sdfsaf sdfdsfs dfsaf sdfds fsdfsaf sdfds fsdfsaf sdfd sfsdfsaf</td>
5    </tr> 
6</table> 
注意,表格的样式应设置如下内容:
   table-layout:fixed;word-wrap:break-word;word-break:break-all;
TD则应设置如下样式:
   text-overflow:ellipsis;overflow:hidden;white-space: nowrap;
当然,你可以把这些样式放到样式表里面去。

2、在HTML页面中显示分数,可用如下格式:
&frac12;
&frac34;
&frac13;

3、使response中顯示的文件名是中文的,可以這樣:
res.setContentType("application/vnd.ms-excel");
    res.setHeader(
"Content-Disposition""attachment;filename="
                    
+ new String(targetFileName.getBytes("big5"), "ISO_8859_1"));
attachment可以改為inline,這樣就會直接顯示在頁面上,而不是下載方式。
如果不寫第二句,也會直接顯示在頁面上。
posted on 2006-08-18 16:40 Robin's Programming World 阅读(1364) 评论(1)  编辑  收藏 所属分类: Java

评论:
# re: Java Web开发中Web层小技巧集锦(不断更新) 2006-10-28 12:11 | redhatlinux10
good but only for ie.期待兼容firefox的版本。  回复  更多评论
  

只有注册用户登录后才能发表评论。


网站导航: