zoukankan      html  css  js  c++  java
  • 我的table类

    /*封装成比较完整的table类,重用率过低了,花点时间包装了一下,对JS又多了层认识*/
    function tableCreater(tablename)
    {
       var t=this.newtable = document.createElement("table");
       t.id=tablename;
       t.style.width="100%"
       this.newtable=t;
       this.rows=new Array();
    }
    tableCreater.prototype.createBody=function(tbname)
    {
      
       this.tbody=document.createElement("tbody");
       this.tbody.id=tbname;
       this.newtable.appendChild(this.tbody);
     
    }
    tableCreater.prototype.addTextRow=function(textarr,style)
    {
      var tr1=document.createElement("tr");
      tr1.className=style;
     
      for(var j=0;j<textarr.length;j++)
         {
          
           var tdarr=tableCreater.prototype.addCell(textarr[j]);
           tr1.appendChild(tdarr);
         }
      this.tbody.appendChild(tr1);
    }

    tableCreater.prototype.addCell=function(text)
    {
      
         var td1=document.createElement("td");
         var ttext=document.createTextNode(text);
         td1.appendChild(ttext);
     
         return td1;
    }
    tableCreater.prototype.addBoxRows=function(texts,names,style)
    {
       var tr=document.createElement("tr");
       tr.className=style;
       for(var j=0;j<names.length;j++)
         {
           var text_1=tableCreater.prototype.addCell(texts[j]);
           var tdarr=tableCreater.prototype.makeBox(names[j]);
           tr.appendChild(text_1);
           tr.appendChild(tdarr);
         }
      this.tbody.appendChild(tr);
    }
    tableCreater.prototype.makeBox=function(name)
    {
      var td=document.createElement("td");
      var box=document.createElement("input");
      box.id=name;
      box.setAttribute("type","text");
      td.appendChild(box);
      return td;
    }
    tableCreater.prototype.gettable=function()
    {
      return this.newtable;
    }

  • 相关阅读:
    angularjs中ng-repeat插入图片
    Torch not compiled with CUDA enabled
    ai 网格变换工具
    ai 网格变换工具
    最后的进入nms的shape数值是怎么来的
    问题import win32api windows下安装pycocotools
    问题、
    输入的图片size为什么是32的倍数,yolo各个模型层说明。upsample+route过程
    YOLO V3代码带注释-阅读笔记系列
    张量或维度表示数学理解思路
  • 原文地址:https://www.cnblogs.com/niuniu502/p/435752.html
Copyright © 2011-2022 走看看