@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;">
<table width="200px" style="border:1px solid #000000;table-layout:fixed;word-wrap:break-word;word-break:break-all;"> 
2 <tr>
    <tr>
3 <td  style="font-size: 11px;text-overflow:ellipsis;overflow:hidden;white-space: nowrap;">
    <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>
    dfasdfdsf sdfsaf sdfdsfs dfsaf sdfds fsdfsaf sdfds fsdfsaf sdfd sfsdfsaf</td>
5 </tr>
    </tr> 
6 </table>
</table>  
注意,表格的样式应设置如下内容:
   
table-layout:fixed;word-wrap:break-word;word-break:break-all;
TD则应设置如下样式:
   text-overflow:ellipsis;overflow:hidden;white-space: nowrap;
当然,你可以把这些样式放到样式表里面去。
2、在HTML页面中显示分数,可用如下格式:
½ 
¾ 
⅓ 
3、使response中顯示的文件名是中文的,可以這樣:
 res.setContentType("application/vnd.ms-excel");
res.setContentType("application/vnd.ms-excel");
    res.setHeader("Content-Disposition", "attachment;filename="
 + new String(targetFileName.getBytes("big5"), "ISO_8859_1"));
                    + new String(targetFileName.getBytes("big5"), "ISO_8859_1"));attachment可以改為inline,這樣就會直接顯示在頁面上,而不是下載方式。
如果不寫第二句,也會直接顯示在頁面上。
	
posted on 2006-08-18 16:40 
Robin's Programming World 阅读(1380) 
评论(1)  编辑  收藏  所属分类: 
Java