javascript动态操作表格:新增、设置样式、删除、移动行
    一、动态设置元素readonly属性时,js里面的readOnly一定要大写O
document.getElementById("id").readOnly=true;
二、动态给表插入行:
function addRow(){
  //动态插入一行,mediaMes是表对象
  var oRow1=mediaMes.insertRow(mediaMes.rows.length);
  //设置tr的id
  oRow1.id="tr"+thisId;
  //获得表总的行数
  var aRows=mediaMes.rows;
  //获得新添加行的列集合
  var aCells=oRow1.cells;
  //再新添加的行里面插入一个列
  var oCell1_1=aRows[oRow1.rowIndex].insertCell(aCells.length);
  //=================设置列的样式======================
  oCell1_1.align="center";
  var oStyle1 = oCell1_1.getAttribute("style");
  //Ie浏览器动态设置样式不能直接给行或列指定class属性
  //要先把样式放到一个对象的attribute里面,然后在把这个对象设置到行或列里面去
  // ie
     if(oStyle1 == "[object]") {
      oStyle1.setAttribute("cssText","border-right: 1px solid #003399;border-bottom: 1px solid #003399;");
        oCell1_1.setAttribute("style",oStyle1 );
     } else {
   oCell1_1.setAttribute("class","td_border" );
     }
  var cell1="<input type='text' name="user"  id='user'/>";
  oCell1_1.innerHTML=cell1;
 } 
三、
       function delRow(rowId){
		var poss=document.getElementById(rowId);
		mediaMes.deleteRow(poss.rowIndex);
	}
四、动态移动table里面的行(tr)
  // 先获得当前行的父节点,就是table
   var parent=aRows[sort].parentNode;
  //table移除一个行,返回的对象就是被移除的行
   var orgNode=parent.removeChild(aRows[sort+1]);
   var destNode=aRows[sort];
  //在一个行前面把这个行插入
   parent.insertBefore(orgNode,destNode);