用HTML里专用空格写法  

解决方案 »

  1.   

    对不起
    是我没有说清楚
    这个空格是显示在option的text里的
    而option的text不是解析html,而是一个String..所以在GB2312的编码下是没有问题的..
      

  2.   

    "option的text不是解析html"
    ???
    ----------------------
    把css拷到源文件中,
    再浏览看看是不是正常的(顺便注意一下css里的字体有没变成乱码)
      

  3.   

    ^_^
    js里...
    var textValue_1 = "test" + " " + ":";
    var textValue_2 = "tes" + " " + " " + ":";document.all.selectId.options[0].text = textValue_1;
    document.all.selectId.options[1].text = textValue_2;在GB2312下":"对齐,在UTF-8下不对齐.....
    不信的朋友可以试一下
      

  4.   

    <br/><font face="MingLiU">111|||tzzgg</font> 
    <br/><font face="MingLiU">wwwWWWt中国</font>
    <br/><font face="黑体">wwwWWWt中国</font>   
    <br/><font face="隶书">wwwWWWt中国</font>     
    <br/><font face="宋体">wwwWWWt中国</font>     
    <br/><font face="新宋体">wwwWWWt中国</font>     
    <br/><font face="幼圆">wwwWWWt中国</font>     -------------
    以上字体是可以对齐的字体,设置一下试试看
      

  5.   

    try:var textValue_1 = "test" + "&nbsp;" + ":";
    var textValue_2 = "tes" + "&nbsp;" + "&nbsp;" + ":";document.all.selectId.options[0].innerHTML = textValue_1;
    document.all.selectId.options[1].innerHTML = textValue_2;
      

  6.   

    注意:
    <select size="1" id="D1" name="D1" style="font-family: Courier New">
      

  7.   

    发现FrontPage的一个bug大家把下面的原代码拷贝到FrontPage下试试:<HTML>
    <HEAD>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <META NAME="GENERATOR" Content="Microsoft FrontPage 4.0">
    <TITLE></TITLE>
    <style>
    option {font-size:20pt}
    </style>
    <SCRIPT ID=clientEventHandlersJS LANGUAGE=vbscript>
    <!--sub button1_onclick
    document.all.D1.options(0).text = "1111" & chr(32) & chr(32) & ":"
    document.all.D1.options(1).text = "11111" & chr(32) & ":"
    document.all.D1.options(2).text = "111111:"
    document.all.D1.options(3).text = "11" & chr(32) & "11" 
    document.all.D1.options(4).text = "11" & chr(32) & "11" 
    end sub//-->
    </SCRIPT>
    </HEAD>
    <BODY><P><INPUT id=button1 type=button value=Button name=button1 onclick="button1_onclick"></P>
    <form name="f1" id="f1">
    <select size="1" id="D1" name="D1" style="font-family: Courier New">
      <option>1111&nbsp;:</option>
      <option>11111:</option>
      <option>aaaaaaaa</option>
      <option>aaaaaaaa</option>
      <option>aaaaaaaa</option>
    </select>
    </form>
    function formatScoreStr(value) 
    {      var l = 20; 
       var newValue 
       var index = value.indexOf(":"); 
       if(index > 0){ 
       
          var tempScore = value.substring(0,index); 
          var tempName = value.substring(index + 1); 
          var scoreLength = tempScore.length; 
          if(scoreLength < l){ 
            var addBlank = l - scoreLength; 
             for(var i =0;i<addBlank;i++){ 
                tempScore = tempScore + " ";
             }
          }
          newValue = tempScore + ":" + tempName;
       }
       
       return newValue;

    </BODY>
    </HTML>