posts - 89, comments - 241, trackbacks - 0, articles - 1
             :: 首頁(yè) ::  :: 聯(lián)系 :: 聚合  :: 管理

          公告


          我參與的團(tuán)隊(duì)

          java

          搜索

          •  

          積分與排名

          • 積分 - 91666
          • 排名 - 631

          最新評(píng)論

          2010年6月26日

               摘要: 代碼改編自 NetPuter 大大發(fā)布的 SDK,這份 SDK 是我用過(guò)的最好的 PHP SDK,修改了一些東西:1、增加了收到的訊息類型 voice video2、收到text的時(shí)候,如果是 hello2bizuser 的話,調(diào)用 onsubscribe 方法(微信4.x 以前貌似都還是發(fā)hello2bizuser 所以不得不兼容啊)Code highlighting produced by A...  閱讀全文

          posted @ 2013-08-24 16:02 saobaolu| 編輯 收藏

          <TABLE style="table-layout: auto | fixed">
          auto: 默認(rèn)值
          fixed: 寬度固定,截?cái)喑龅膬?nèi)容

          <TABLE style="word-break: normal | break-all | keep-all">
          normal: 默認(rèn)值,按字詞截?cái)鄵Q行
          break-all: 強(qiáng)行截?cái)嗖Q行
          keep-all: 不截?cái)嗖粨Q行

          使用:style="table-layout:fixed;"
          表示輸出停止,停留在設(shè)定的長(zhǎng)度內(nèi).

          使用:style="word-break : break-all;"
          表示對(duì)超長(zhǎng)部分,換行再繼續(xù)顯示.

          對(duì)于在英文中使用,請(qǐng)使用style="table-layout:fixed; word-wrap:break-word"
          推薦使用word-wrap:break-word;word-break:break-all;table-layout:fixed;

          ==============================================================================

          word-wrap同word-break的區(qū)別

          word-wrap:
          normal      Default. Content exceeds the boundaries of its container. 
          break-word Content wraps to next line, and a word-break occurs when necessary. 必要時(shí)會(huì)觸發(fā)word-break。

          word-break:
          normal      Default. Allows line breaking within words. 好像是只對(duì)Asian text起作用。
          break-all Behaves the same as normal for Asian text, yet allows the line to break arbitrarily for non-Asian text. This value is suited to Asian text that contains some excerpts of non-Asian text. 
          keep-all Does not allow word breaking for Chinese, Japanese, and Korean. Functions the same way as normal for all non-Asian languages. This value is optimized for text that includes small amounts of Chinese, Japanese, or Korean.

          總結(jié)如下:
          word-wrap是控制換行的。
          使用break-word時(shí),是將強(qiáng)制換行。中文沒有任何問題,英文語(yǔ)句也沒問題。但是對(duì)于長(zhǎng)串的英文,就不起作用。

          break-word是控制是否斷詞的。
          normal是默認(rèn)情況,英文單詞不被拆開。
          break-all,是斷開單詞。在單詞到邊界時(shí),下個(gè)字母自動(dòng)到下一行。主要解決了長(zhǎng)串英文的問題。
          keep-all,是指Chinese, Japanese, and Korean不斷詞。即只用此時(shí),不用word-wrap,中文就不會(huì)換行了。(英文語(yǔ)句正常。)


          ie下:
          使用word-wrap:break-word;所有的都正常。

          ff下:
          如這2個(gè)都不用的話,中文不會(huì)出任何問題。英文語(yǔ)句也不會(huì)出問題。但是,長(zhǎng)串英文會(huì)出問題。
          為了解決長(zhǎng)串英文,一般用word-wrap:break-word;word-break:break-all;。但是,此方式會(huì)導(dǎo)致,普通的英文語(yǔ)句中的單詞會(huì)被斷開(ie下也是)。

          目前主要的問題存在于 長(zhǎng)串英文 和 英文單詞被斷開。其實(shí)長(zhǎng)串英文就是一個(gè)比較長(zhǎng)的單詞而已。
          即英文單詞應(yīng)不應(yīng)該被斷開那?那問題很明顯了,顯然不應(yīng)該被斷開了。
          對(duì)于長(zhǎng)串英文,就是惡意的東西,自然不用去管了。但是,也要想些辦法,不讓它把容器撐大。
          用:overflow:auto; ie下,長(zhǎng)串會(huì)自動(dòng)折行。ff下,長(zhǎng)串會(huì)被遮蓋。


          所以,綜上,最好的方式是word-wrap:break-word;overflow:hidden;而不是word-wrap:break-word;word-break:break-all;。
          word-wrap:break-word;overflow:auto;在ie下沒有任何問題。在ff下,長(zhǎng)串會(huì)被遮住部分內(nèi)容。

          另,測(cè)試代碼如下:

          1.htm===================================================================

          <style>
          .c1{ width:300px;      border:1px solid red}
          .c2{ width:300px;word-wrap:break-word;      border:1px solid yellow}
          .c3{ width:300px;word-wrap:break-word;word-break:break-all;      border:1px solid green}
          .c4{ width:300px;word-wrap:break-word;word-break:keep-all; border:1px solid blue}
          .c5{ width:300px;word-break:break-all;      border:1px solid black}
          .c6{ width:300px;word-break:keep-all;      border:1px solid red}
          .c7{ width:300px;word-wrap:break-word;overflow:auto;      border:1px solid yellow}
          </style>

          .c1{ width:300px;      border:1px solid red}
          <div class="c1">
          safjaskflasjfklsajfklasjflksajflksjflkasjfksafj
          </div>
          <div class=c1>
          This is all English. This is all English. This is all English.
          </div>
          <div class=c1>
          全是中文的情況。全是中文的情況。全是中文的情況。
          </div>
          <div class=c1>
          中英文混排的情況。Chinese and English. 中英文混排的情況。Chinese and English. 
          </div>

          <br>
          .c2{ width:300px;word-wrap:break-word; border:1px solid yellow}
          <div class="c2">
          safjaskflasjfklsajfklasjflksajflksjflkasjfksafj
          </div>
          <div class=c2>
          This is all English. This is all English. This is all English.
          </div>
          <div class=c2>
          全是中文的情況。全是中文的情況。全是中文的情況。
          </div>
          <div class=c2>
          中英文混排的情況。Chinese and English. 中英文混排的情況。Chinese and English. 
          </div>

          <br>
          .c3{ width:300px;word-wrap:break-word;word-break:break-all;      border:1px solid green}
          <div class="c3">
          safjaskflasjfklsajfklasjflksajflksjflkasjfksafj
          </div>
          <div class=c3>
          This is all English. This is all English. This is all English.
          </div>
          <div class=c3>
          全是中文的情況。全是中文的情況。全是中文的情況。
          </div>
          <div class=c3>
          中英文混排的情況。Chinese and English. 中英文混排的情況。Chinese and English. 
          </div>

          <br>
          .c4{ width:300px;word-wrap:break-word;word-break:keep-all; border:1px solid blue}
          <div class="c4">
          safjaskflasjfklsajfklasjflksajflksjflkasjfksafj
          </div>
          <div class=c4>
          This is all English. This is all English. This is all English.
          </div>
          <div class=c4>
          全是中文的情況。全是中文的情況。全是中文的情況。
          </div>
          <div class=c4>
          中英文混排的情況。Chinese and English. 中英文混排的情況。Chinese and English. 
          </div>

          <br>
          .c5{ width:300px;word-break:break-all;      border:1px solid black}
          <div class="c5">
          safjaskflasjfklsajfklasjflksajflksjflkasjfksafj
          </div>
          <div class=c5>
          This is all English. This is all English. This is all English.
          </div>
          <div class=c5>
          全是中文的情況。全是中文的情況。全是中文的情況。
          </div>
          <div class=c5>
          中英文混排的情況。Chinese and English. 中英文混排的情況。Chinese and English. 
          </div>

          <br>
          .c6{ width:300px;word-break:keep-all;      border:1px solid red}
          <div class="c6">
          safjaskflasjfklsajfklasjflksajflksjflkasjfksafj
          </div>
          <div class=c6>
          This is all English. This is all English. This is all English.
          </div>
          <div class=c6>
          全是中文的情況。全是中文的情況。全是中文的情況。
          </div>
          <div class=c6>
          中英文混排的情況。Chinese and English. 中英文混排的情況。Chinese and English. 
          </div>

          <br>
          .c7{ width:300px;word-wrap:break-word;overflow:auto;      border:1px solid yellow}
          <div class="c7">
          safjaskflasjfklsajfklasjflksajflksjflkasjfksafj
          </div>
          <div class=c7>
          This is all English. This is all English. This is all English.
          </div>
          <div class=c7>
          全是中文的情況。全是中文的情況。全是中文的情況。
          </div>
          <div class=c7>
          中英文混排的情況。Chinese and English. 中英文混排的情況。Chinese and English. 
          </div>

          posted @ 2010-07-06 22:43 saobaolu| 編輯 收藏

           1 import java.io.*;
           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];  //聲明一個(gè)空的數(shù)組  10個(gè)長(zhǎng)度
           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 }
          最后應(yīng)該把p給close了哈

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

          主站蜘蛛池模板: 珲春市| 玉树县| 北川| 峨山| 海伦市| 思南县| 高州市| 惠安县| 芷江| 汶上县| 石泉县| 灵丘县| 南康市| 广昌县| 赤壁市| 札达县| 洱源县| 河南省| 嵊泗县| 平江县| 嘉鱼县| 大石桥市| 寻甸| 贵定县| 崇仁县| 中西区| 嵩明县| 永新县| 巴马| 宜城市| 芒康县| 彭泽县| 萨嘎县| 当涂县| 惠来县| 玉屏| 昌江| 柳河县| 竹溪县| 天峨县| 大方县|