posted @ 2013-08-24 16:02 saobaolu| 編輯 收藏
<TABLE style="table-layout: auto | fixed"> 使用:style="word-break : break-all;" 對于在英文中使用,請使用style="table-layout:fixed; word-wrap:break-word" ============================================================================== word-wrap同word-break的區(qū)別 word-wrap: word-break: 總結(jié)如下: break-word是控制是否斷詞的。
ff下: 目前主要的問題存在于 長串英文 和 英文單詞被斷開。其實(shí)長串英文就是一個比較長的單詞而已。
另,測試代碼如下: 1.htm=================================================================== <style> .c1{ width:300px; border:1px solid red} <br> <br> <br> <br> <br> <br> |
posted @ 2010-07-06 22:43 saobaolu| 編輯 收藏
2 import java.util.Scanner;
3 public class SortTest {
4 public static void main(String[] args) throws IOException {
5 int temp = 0;//臨時(shí)變量,用于冒泡交換
6 int[] num=new int[10]; //聲明一個空的數(shù)組 10個長度
7 Scanner sc = new Scanner(System.in);
8 FileOutputStream out=new FileOutputStream("1.txt");
9 PrintStream p=new PrintStream(out);
10 //開始循環(huán)賦值
11 for(int i =0;i<num.length;i++){
12 num[i]=sc.nextInt();
13 }
14 p.append("排序前為:");
15 for (int i = 0; i <num.length; i++) {
16 System.out.println(num[i]);
17 p.append(num[i]+" , ");
18 }
19 // 用于排序
20 for (int i = 0; i < num.length-1; i++) {
21 for (int j = 0; j < num.length - i - 1; j++) {
22 if (num[j] > num[j + 1]) {
23 temp = num[j];
24 num[j] = num[j + 1];
25 num[j + 1] = temp;
26 }
27 }
28 }
29 //輸出文件
30 p.append("\n");
31 p.append("排序后為:");
32 // 循環(huán)輸出
33 System.out.println("排序后為:");
34 for (int i = 0; i <num.length; i++) {
35 System.out.println(num[i]);
36 p.append(num[i]+" , ");
37 }
38
39
40 }
41 }
posted @ 2010-06-26 09:02 saobaolu| 編輯 收藏
轉(zhuǎn)自:http://www.ry168.net/bbs/thread-226-1-1.html
table不能換行問題 一般是:一行里面全是數(shù)字或是字母或者結(jié)尾有多個感嘆號而導(dǎo)致 table不能換行,中文默認(rèn)的會自動換行的,字母不能換行問題:
style="table-layout:fixed; word-break: break-all; overflow:hidden;"
復(fù)制代碼在單元格屬性里加入上面這句,如:
<td style="table-layout:fixed; word-break: break-all; overflow:hidden;">
復(fù)制代碼用表格做網(wǎng)頁排版的時(shí)候,一般都能正常使用。偏偏有時(shí)會碰到一段連續(xù)的英文詞或者一堆感嘆號(!!!)把網(wǎng)頁就撐開的現(xiàn)象。
總結(jié)了一下,只要在CSS中定義了如下句子,可保網(wǎng)頁不會再被撐開了。
自動換行問題,正常字符的換行是比較合理的,而連續(xù)的數(shù)字和英文字符常常將容器撐大,挺讓人頭疼,下面介紹的是CSS如何實(shí)現(xiàn)換行的方法
對于div,p等塊級元素
正常文字的換行(亞洲文字和非亞洲文字)元素?fù)碛心J(rèn)的white-space:normal,當(dāng)定義的寬度之后自動換行
html
<div id="wrap">正常文字的換行(亞洲文字和非亞洲文字)元素?fù)碛心J(rèn)的white-space:normal,當(dāng)定義</div>
css
#wrap{white-space:normal; width:200px; }
IE瀏覽器
連續(xù)的英文字符和阿拉伯?dāng)?shù)字,使用word-wrap: break-word ;或者word-break:break-all;實(shí)現(xiàn)強(qiáng)制斷行
html
<div id="wrap">abcdefghijklmnabcdefghijklmnabcdefghijklmn111111111</div>
css
#wrap{word-break:break-all; width:200px;}
或者
#wrap{word-wrap:break-word; width:200px;}
Firefox瀏覽器
連續(xù)的英文字符和阿拉伯?dāng)?shù)字的斷行,Firefox的所有版本的沒有解決這個問題,我們只有讓超出邊界的字符隱藏或者,給容器添加滾動條
html
<div id="wrap">abcdefghijklmnabcdefghijklmnabcdefghijklmn111111111</div>
css
#wrap{word-break:break-all; width:200px; overflow:auto;}
對于table元素
IE瀏覽器
1. 使用 table-layout:fixed;強(qiáng)制table的寬度,多余內(nèi)容隱藏<table style="table-layout:fixed" width="200"><tr><td>abcdefghigklmnopqrstuvwxyz1234567890ssssssssssssss</td></tr></table>
復(fù)制代碼2. 使用 table-layout:fixed;強(qiáng)制table的寬度,內(nèi)層td,th采用word-break : break-all;或者word-wrap : break-word ;換行 <table width="200" style="table-layout:fixed;"><tr><td width="25%" style="word-break : break-all; ">abcdefghigklmnopqrstuvwxyz 1234567890</td><td style="word-wrap : break-word ;">abcdefghigklmnopqrstuvwxyz 1234567890</td></tr></table>
復(fù)制代碼3.在td,th中嵌套div,p等采用上面提到的div,p的換行方法
Firefox瀏覽器
1. 使用 table-layout:fixed;強(qiáng)制table的寬度,內(nèi)層td,th采用word-break : break-all;或者word-wrap : break-word ;換行,使用overflow:hidden;隱藏超出內(nèi),這里overflow:auto;無法起作用<table style="table-layout:fixed" width="200"><tr>
<td width="25%" style="word-break : break-all; overflow:hidden; ">abcdefghigklmnopqrstuvwxyz1234567890</td>
<td width="75%" style="word-wrap : break-word; overflow:hidden; ">abcdefghigklmnopqrstuvwxyz1234567890</td>
</tr></table>
復(fù)制代碼2.在td,th中嵌套div,p等采用上面提到的對付Firefox的方法。
最佳CSS定義換行代碼.wrap { table-layout:fixed; word-break: break-all; overflow:hidden; }
復(fù)制代碼當(dāng)然,這種現(xiàn)象出現(xiàn)的幾率很小,但是不能排除網(wǎng)友的惡搞。
posted @ 2010-06-25 14:06 saobaolu| 編輯 收藏
發(fā)現(xiàn)這個玩意越來越強(qiáng)大了,就忍不住把官方的介紹搬過來:
代碼樣例

1)、sigkey為個人鑒權(quán)key,請勿修改,否則無法發(fā)起臨時(shí)會話。
2)、臨時(shí)會話圖標(biāo)<img border="0" SRC='http://wpa.qq.com/pa?p=1:80000805:1' alt="點(diǎn)擊這里給我發(fā)消息">
SRC是圖標(biāo)鏈接,自定義圖標(biāo)中可以替換這一部分為自己圖片的鏈接,
參數(shù):
P=以冒號“:”分隔多個參數(shù)
第一個參數(shù)為版本號,目前為1;
第二個為QQ/TM號碼;
第三個參數(shù)為圖像風(fēng)格,支持多種狀態(tài)。
alt是圖標(biāo)旁留言。
3)、除了自定義圖標(biāo)需要修改臨時(shí)會話圖標(biāo)外,其他情況下建議不要修改代碼,因?yàn)橛锌赡軐?dǎo)致在不同的環(huán)境和瀏覽器下,無法發(fā)起臨時(shí)會話。
自定義在線風(fēng)格圖片
用JS實(shí)現(xiàn),具體步驟如下:
1) 申請代碼
2) 定義online數(shù)組,必須是online命名
<script>var online= new Array();</script>
3) 獲取在線狀態(tài)
<script src="http://webpresence.qq.com/getonline?Type=1&80000805:"></script>
可以獲取多個,必須以冒號分隔,以冒號結(jié)尾,比如:
<script src="http://webpresence.qq.com/getonline?Type=1&80000805:10000:123456:"></script>
online[0]=0,表示80000805離線
online[1]=1,表示10000在線
online[2]=1,表示123456在線
填寫號碼的先后順序,分別對應(yīng)數(shù)組online的0、1、2
4) 添加代碼
把SRC='http://wpa.qq.com/pa?p=1:80000805:1'替換為自己的圖片,比如:
else document.write("<a href="http://sighttp.qq.com/cgi-bin/check?sigkey=81a37f0b7cac68639bddfdb9b93a6c92bc211f3e3a4e683afbb31a079382dc9d"; target=_blank; onclick="var tempSrc='http://sighttp.qq.com/wpa.js?rantime='+Math.random()+'&sigkey=81a37f0b7cac68639bddfdb9b93a6c92bc211f3e3a4e683afbb31a079382dc9d';var oldscript=document.getElementById('testJs');var newscript=document.createElement('script');newscript.setAttribute('type','text/javascript'); newscript.setAttribute('id', 'testJs');newscript.setAttribute('src',tempSrc);if(oldscript == null){document.body.appendChild(newscript);}else{oldscript.parentNode.replaceChild(newscript, oldscript);}return false;"><img border="0" SRC='http://xxxx/online.jpg' alt="點(diǎn)擊這里給我發(fā)消息"></a>"); </script>
我是這樣看的,用tx的方法得到某QQ號是否在線,用js判斷,顯示online.jpg或者outline.jpg這兩個圖片,其余不變。
posted @ 2010-06-25 07:28 saobaolu| 編輯 收藏
import java.io.*;
public class MyEclipseGen

private static final String LL = "Decompiling this copyrighted software is a violation of both your license agreement and the Digital Millenium Copyright Act of 1998 (http://www.loc.gov/copyright/legislation/dmca.pdf). Under section 1204 of the DMCA, penalties range up to a $500,000 fine or up to five years imprisonment for a first offense. Think about it; pay for a license, avoid prosecution, and feel better about yourself.";
public String getSerial(String userId, String licenseNum)

java.util.Calendar cal = java.util.Calendar.getInstance();
cal.add(1, 3);
cal.add(6, -1);
java.text.NumberFormat nf = new java.text.DecimalFormat("000");
licenseNum = nf.format(Integer.valueOf(licenseNum));
String verTime = new StringBuilder("-").append(new java.text.
SimpleDateFormat("yyMMdd").format(cal.getTime())).append("0").
toString();
String type = "YE3MP-";
String need = new StringBuilder(userId.substring(0, 1)).append(type).
append("300").append(licenseNum).append(verTime).toString();
String dx = new StringBuilder(need).append(LL).append(userId).toString();
int suf = this.decode(dx);
String code = new StringBuilder(need).append(String.valueOf(suf)).
toString();
return this.change(code);
}
private int decode(String s)

int i;
char[] ac;
int j;
int k;
i = 0;
ac = s.toCharArray();
j = 0;
k = ac.length;
while (j < k)

i = (31 * i) + ac[j];
j++;
}
return Math.abs(i);
}
private String change(String s)

byte[] abyte0;
char[] ac;
int i;
int k;
int j;
abyte0 = s.getBytes();
ac = new char[s.length()];
i = 0;
k = abyte0.length;
while (i < k)

j = abyte0[i];
if ((j >= 48) && (j <= 57))

j = (((j - 48) + 5) % 10) + 48;
} else if ((j >= 65) && (j <= 90))

j = (((j - 65) + 13) % 26) + 65;
} else if ((j >= 97) && (j <= 122))

j = (((j - 97) + 13) % 26) + 97;
}
ac[i] = (char) j;
i++;
}
return String.valueOf(ac);
}
public MyEclipseGen()

super();
}
public static void main(String[] args)

try

System.out.println("please input register name:");
BufferedReader reader = new BufferedReader(new InputStreamReader(
System.in));
String userId = null;
userId = reader.readLine();
MyEclipseGen myeclipsegen = new MyEclipseGen();
String res = myeclipsegen.getSerial(userId, "20");
System.out.println("Serial:" + res);
reader.readLine();
} catch (IOException ex)

}
}
}
/Files/chenglu/MyEclipse61Gen.zip
額,還有,MyEclipse6的下載地址是:請使用迅雷下載。。http://downloads.myeclipseide.com/downloads/products/eworkbench/6.0.1GA/MyEclipse_6.0.1GA_E3.3.1_FullStackInstaller.exe
posted @ 2010-06-19 22:09 saobaolu| 編輯 收藏
<label>選擇分類</label>
<select name="classId">
<option value="1">企業(yè)動態(tài)</option>
<option value="2">最新活動</option>
</select>
</p>
public void setTitle(String title) {
this.title = title;
}
public String getClassId() {
return classId;
}
posted @ 2010-06-17 07:12 saobaolu| 編輯 收藏













posted @ 2010-06-16 09:09 saobaolu| 編輯 收藏


2

3

4

5


6

posted @ 2010-03-22 21:24 saobaolu| 編輯 收藏
posted @ 2010-01-26 11:17 saobaolu| 編輯 收藏