HTML Table td 自动换行(中英文)|js 去除数据重复数据

<table width="200px" border="1" >  

<tr>  

<td style="word-break:break-all; word-wrap:break-word;" >序号序号序号序号序号序号序号序号序号序号序号序号序号序号序号序号序号</td>  

<td style="word-break:break-all; word-wrap:break-word;">dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddD</td>  

<td style="word-break:break-all; word-wrap:break-word;">111111111111111111111111111111111111111111111111111111111111111111111111111111</td>  

 <td style="word-break:break-all; word-wrap:break-word;">!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</td>  

 </tr>  

</table>  

 

 

 

  1.   Array.prototype.distinct = function() {   
  2.             for (var i = 0; i < this.length; i++) {   
  3.              for (var j = i+1; j < this.length;) {   
  4.                  if (this[i].id === this[j].id) {   
  5.                      ret.push(this.splice(j, 1)[0]);   
  6.                  } else {   
  7.                      j++;   
  8.                  }   
  9.              }   
  10.             }   
  11.             return ret;   
  12. }  

 

 说明:此实例数组类型为
var values =new Object();
values.id= getValues[i].id;
values.text= getValues[i].text;
values.checked="1";

所以:判断条件为  if (this[i].id === this[j].id)
如果数据类型为
var s = [1,2,3····n];
则,修改为
if (this[i] === this[j])
即可!

 

 

你可能感兴趣的:(自动换行,table,tr,td)