JS创建自定义表格具体实现

  JS部分:

  

复制代码 代码如下:

  function next() {

  //得到table对象

  var oTable = document.getElementById("table1");

  //插入tr

  var oTr = oTable.insertRow();

  //一行tr插入3个td

  var oTd1 = oTr.insertCell();

  var oTd2 = oTr.insertCell();

  var oTd3 = oTr.insertCell();

  //指定td内容

  oTd1.innerHTML = "@process_time显示处理某个页面所需要的时间";

  oTd2.innerHTML = "无需设置参数";

  oTd3.innerHTML = "无需设置参数值";

  }

  JSP:

  

复制代码 代码如下:

  <table style="width:700px;" id="table1">

  <thead >

  <tr>

  <th>

  参数描述

  </th>

  <th>

  包含此参数

  </th>

  <th>

  参数值

  </th>

  </tr>

  </thead>

  </table>