<div class="htmlarea"><textarea id="runcode29630"> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <style type="text/css">*{font-size:14px}button{margin:3px}</style> <script type="text/javascript"> var mytable=null,mytable2=null; window.onload=function(){ mytable=new CTable("tbl",10); mytable2=new CTable("tbl2",6); } Array.prototype.each=function(f){for(var i=0;i<this.length;i++) f(this[i],i,this)} function $A(arrayLike){ for(var i=0,ret=[];i<arrayLike.length;i++) ret.push(arrayLike[i]); return ret } Function.prototype.bind = function() { var __method = this, args = $A(arguments), object = args.shift(); return function() { return __method.apply(object, args.concat($A(arguments))); } } function CTable(id,rows){ this.tbl=typeof(id)=="string"?document.getElementById(id):id; if (rows && /^\d+$/.test(rows)) this.addrows(rows) } CTable.prototype={ addrows:function(n){ //</script></textarea></div>