首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > CSS >

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

2012-09-05 
HTML Table td 自动换行(中英文)|js 去除数据重复数据table?width200px?border1???tr??td?styl

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>??

?

?

?

    ??Array.prototype.distinct?=?function()?{ ??????????????for?(var?i?=?0;?i?<?this.length;?i++)?{ ???????????????for?(var?j?=?i+1;?j?<?this.length;)?{ ???????????????????if?(this[i].id?===?this[j].id)?{ ???????????????????????ret.push(this.splice(j,?1)[0]); ???????????????????}?else?{ ???????????????????????j++; ???????????????????} ???????????????} ??????????????} ??????????????return?ret; ??}??

?

?说明:此实例数组类型为
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])
即可!

?

?

热点排行