2007-12-04
关于换行
关键字: 换行
java取消换行,CSS强制换行...竟然忘记了....汗!
java 取消换行代码
- public class Formatter {
- public static void main(String...args) {
- try
- {
- BufferedReader reader = new BufferedReader(new FileReader("D://in.txt"));
- String sReadLine = reader.readLine();
- StringBuilder sAllContext = new StringBuilder();
- while(sReadLine!=null)
- {
- sAllContext.append(sReadLine);
- sReadLine = reader.readLine();
- }
- reader.close();
- PrintWriter pw = new PrintWriter(new FileOutputStream("D://out.txt"));
- pw.println(format(sAllContext.toString()));
- pw.close();
- }
- catch(Exception e){
- e.printStackTrace();
- }
- }
- static String format(String str){
- String reStr = str.replaceAll("\t", " ");
- reStr = reStr.replaceAll("\r\n", " ");
- return reStr;
- }
- }
CSS强制换行代码
- ->div 便签解决方法
-
- white-space:normal; word-break:break-all;这里前者是遵循标准。
- (如果直接加在TD 则:style=" word-break: break-all;")
- #wrap{white-space:normal; width:200px; }
- 或者
- #wrap{word-break:break-all;width:200px;}
-
- < div id=" wrap " width="80">将我换行< /div>
-
- ->table 标签解决方法
-
- < style>
- .tb{table-layout:fixed}
- < /style>
-
- < table class="tbl" width="80">
- < tr>< td>将我换行 < /td>< /tr>
- < /table>
-
- < table class="tb" width="80">
- < tr>< td nowrap>将我换行< /td>< /tr>
- < /table>
-
- < table class="tb" width=80>
- < tr>
- < td width=25% nowrap>将我换行< /td>
- < td nowrap>将我换行< /td>
- < /tr>
- < /table>
发表评论
- 浏览: 16491 次
- 性别:

- 来自: 上海

- 详细资料
搜索本博客
我的相册
me
共 6 张
共 6 张
最近加入圈子
最新评论
-
25 Skills Every Man Shou ...
菜头版的----好强....
-- by linxizeng -
25 Skills Every Man Shou ...
和菜头版 http://www.hecaitou.com/?p=2405
-- by 庄表伟 -
25 Skills Every Man Shou ...
呵呵,我觉得会用google比这里面的大部分技能都更有用,只除了像拯救落水船员这 ...
-- by gigix -
读 软件架构的十大错误 ...
现在,做什么都要考虑代价,如果要做的事情的代价高于没做的损失,当然就是不要做了。
-- by hyhongyong -
一句话Java设计模式
我觉得你这些解释对于理解设计模式没啥帮助,而且感觉有些理解容易误导别人。投个隐藏 ...
-- by movingboy






评论排行榜