zoukankan
html css js c++ java
通过js 向table添加或修改row及cell
//取得table对象
var tabObj = document.getElementById("tabTipResult");
//目前table有多少行
var rowCount = tabObj.rows.length;
//每行有多少列
var cellCount = tabObj.rows(0).cells.length;
if(rowCount < pageCount)
{
for(var i=0;i< pageCount ;i++)
{
//循环 向table增加新行
var newRow = tabObj.insertRow(rowCount++);
for(var j=0;j<cellCount;j++)
{
//每行的新列值
newRow.insertCell(j).innerHTML="无";
}
}
}
else
{
for(var i=1;i<= pageCount ;i++)
{
var tmpRow = tabObj.rows(i);
for(var j=0;j<cellCount;j++)
{
tmpRow.cells(j).innerHTML="无";
}
//该行的背景色属性
tmpRow .onmouseout = function(){this.bgColo
r="white";};
tmpRow .onmouseover= function(){this.bgColor="#efffff";};
//td 在 onclick事件
tmpRow .cells(0).onclick = function(){ alert("");};
}
}
查看全文
相关阅读:
团队项目-选题报告
第一次结对编程作业
第一次个人编程作业
第一次软工作业
antd form表单数组对象格式
antd form表单验证失去焦点时验证和重置验证状态
fetch请求
typescript类装饰器
typescript泛型
浮点数问题
原文地址:https://www.cnblogs.com/freeliver54/p/600419.html
最新文章
linux 终端printf打印显示乱码问题修正
把TYPORA改为微软雅黑+CONSOLAS
svn更改ip
SVN 回退到某一个版本
第06组 Alpha事后诸葛亮
第06组 Alpha冲刺(4/4)
第06组 Alpha冲刺(3/4)
第06组 Alpha冲刺(2/4)
第06组 Alpha冲刺(1/4)
第06组 团队Git现场编程实战
热门文章
第二次结对编程作业
团队项目-需求分析报告
团队项目-选题报告
第一次结对编程作业
Alpha3
Alpha2
Alpha冲刺(1/4)
第06组 团队Git现场编程实战
团队项目-需求分析报告
第二次结对编程作业
Copyright © 2011-2022 走看看