css屬性border-collapse(細表格)empty-cells(顯示空列,沒看出來效果)text-transform(大小寫)

來源:互聯網
上載者:User

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br /><html xmlns="http://www.w3.org/1999/xhtml" ><br /><head><br /> <title>css的兩個屬性border-collapse(細表格)empty-cells(顯示空列,沒看出來效果)text-transform(大小寫)</title><br /> <mce:style type="text/css"><!--<br /> table.coll /*只有class屬性為coll的才應用*/<br /> {<br /> border-collapse: collapse<br /> }<br /> table.sep<br /> {<br /> border-collapse: separate<br /> }<br /> .table/**/<br /> {<br /> border-collapse: separate;<br /> empty-cells: show<br /> }</p><p>--></mce:style><style type="text/css" mce_bogus="1"> table.coll /*只有class屬性為coll的才應用*/<br /> {<br /> border-collapse: collapse<br /> }<br /> table.sep<br /> {<br /> border-collapse: separate<br /> }<br /> .table/**/<br /> {<br /> border-collapse: separate;<br /> empty-cells: show<br /> }<br /> </style><br /> <mce:script type="text/javascript"><!--<br /> /***********************************<br /> /g是global全域替換,如果沒有這個標識,只替換第一處<br /> /asdf/gi,i是忽略大小寫。<br /> 還有個m不常用,是否換行匹配<br /> ***********************************/<br /> String.prototype.htmlEncode = function(){<br /> return this.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(//n/g,"<br />");<br /> };<br /> function f(){<br /> document.getElementById("div1").innerHTML="<00<0>".htmlEncode();//編碼之後<br /> alert("<00<0>".htmlEncode());<br /> document.getElementById("div2").innerHTML=document.getElementById("Text1").value.htmlEncode();//輸入<>/n之類試試<br /> alert(document.getElementById("Text1").value.htmlEncode());<br /> }</p><p>// --></mce:script><br /></head><br /><body><br /><input id="Text1" type="text" value="<>/n" /><br /><div id="div1">hello</div><br /><input type="button" value="ok" onclick="f();" /><br /><div id="div2">hi</div></p><p><table class="coll" border="1"><br /> <tr><br /> <td>hello</td><br /> <td>hello</td><br /> </tr><br /> <tr><br /> <td>hello</td><br /> <td>hello</td><br /> </tr><br /></table><br /><table class="sep" border="1"><br /> <tr><br /> <td>hello</td><br /> <td>hello</td><br /> </tr><br /> <tr><br /> <td>hello</td><br /> <td>hello</td><br /> </tr><br /></table><br /><table border="1" class="table" style=" empty-cells:hide; text-transform:uppercase;" mce_style=" empty-cells:hide; text-transform:uppercase;"><br /> <tr><br /> <td>hello</td><br /> <td>hello</td><br /> </tr><br /> <tr><br /> <td></td><br /> <td>hello</td><br /> </tr><br /></table><br /></body><br /></html><br />

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.