1.

2.

3.

 function ChangeTable()

   {
var type = document.getElementById("ddl_ReportType").value.Trim(); if (type == )
{
document.getElementById("TableInfo").innerHTML = TableYX();
}
else if (type == )
{
document.getElementById("TableInfo").innerHTML = TablePY();
} else if (type == )
{
document.getElementById("TableInfo").innerHTML = TableGL();
}
else if (type == )
{
document.getElementById("TableInfo").innerHTML = TableLG();
}
} function TableGL()
{
var str = "<table name='tblSlt' width='100%' border='0' runat='server' align='center' cellpadding='0' cellspacing='1' bgcolor='#999999'>";
str += " <tbody><tr>"; str += " <td class='ListTitle' style='font-weight: bolder;width:50px;' background='../../../images/Main/tableTitle_bg.jpg'>项目名称</td>";
str += " <td class='ListTitle' style='font-weight: bolder;width:50px;' background='../../../images/Main/tableTitle_bg.jpg'>原工资</td>";
str += " <td class='ListTitle' style='font-weight: bolder;width:50px;' background='../../../images/Main/tableTitle_bg.jpg'>修改后工资</td>";
str += " <td class='ListTitle' style='font-weight: bolder;width:50px;' background='../../../images/Main/tableTitle_bg.jpg'></td>"; str += " </tr></tbody>";
str += " <tr>";
str += " <td class='tdColInputCenter' style='font-weight: bolder;width:50px;'>" +
"<select id='SltId' name='SltName' style='width:100%;'> <option value='0' selected='selected'>请选择</option>" +
" <option value='JBGZ_'>工资</option> <option value='BLGZ_'>保留工资</option> <option value='DTF_'>独贴</option> " +
"<option value='MTF_'>民贴</option> <option value='QTY_'>其他</option> <option value='KCBJ_'>扣病事假</option>" +
"<option value='YLJ_'>养老金</option> <option value='YBJ_'>医保金</option> <option value='SBJ_'>失保金</option>" +
"<option value='GJJ_'>公积金</option> <option value='BFGJJ_'>补充公积金</option> <option value='GHF_'>工会费</option>" +
"<option value='QT_'>其他</option> <option value='GTS_'>个调税</option></select> </td>";
str += " <td class='tdColInputCenter' style='font-weight: bolder;width:50px;'><input type='text' maxlength = '12' style='width:100%;' class='tdinput' id='inputJBGZ' /></td>"; //onchange=\"AllUpdate('JBGZ')\"
str += " <td class='tdColInputCenter' style='font-weight: bolder;width:50px;'><input type='text' maxlength = '12' style='width:100%;' class='tdinput' id='inputJiangJ' /></td>" //onchange=\"AllUpdate('JiangJ')\"
str += " <td class='tdColInputCenter' style='font-weight: bolder;width:50px;' align='center'><input type='button' style='background:url(../../../images/Button/Button_Change.jpg); width:55px; Height:30px;' onclick =\"AllUpdate('JZZYBF')\" id='JZZYBF' /></td>"; str += " </tr> ";
str += "</table>";
return str;
} function TableLG()
{
var str = "<table name='tblSlt' width='100%' border='0' runat='server' align='center' cellpadding='0' cellspacing='1' bgcolor='#999999'>";
str += " <tbody><tr>"; str += " <td class='ListTitle' style='font-weight: bolder;width:50px;' background='../../../images/Main/tableTitle_bg.jpg'>项目名称</td>";
str += " <td class='ListTitle' style='font-weight: bolder;width:50px;' background='../../../images/Main/tableTitle_bg.jpg'>原工资</td>";
str += " <td class='ListTitle' style='font-weight: bolder;width:50px;' background='../../../images/Main/tableTitle_bg.jpg'>修改后工资</td>";
str += " <td class='ListTitle' style='font-weight: bolder;width:50px;' background='../../../images/Main/tableTitle_bg.jpg'></td>"; str += " </tr></tbody>";
str += " <tr>";
str += " <td class='tdColInputCenter' style='font-weight: bolder;width:50px;'>" +
"<select id='SltId' name='SltName' style='width:100%;'> <option value='0' selected='selected'>请选择</option> " +
"<option value='JBGZ_'>生活费</option> <option value='FTF_'>社保金</option> " +
" <option value='CTF_'>公积金</option><option value='DTF_'>独贴</option> <option value='MTF_'>民贴</option>" +
"<option value='QTY_'>其他</option> <option value='YLJ_'>养老金</option> <option value='YBJ_'>医保金</option>" +
"<option value='SBJ_'>失业金</option> <option value='GJJ_'>公积金</option> <option value='QT_'>其他</option> </select></td>";
str += " <td class='tdColInputCenter' style='font-weight: bolder;width:50px;'><input type='text' maxlength = '12' style='width:100%;' class='tdinput' id='inputJBGZ' /></td>";
str += " <td class='tdColInputCenter' style='font-weight: bolder;width:50px;'><input type='text' maxlength = '12' style='width:100%;' class='tdinput' id='inputJiangJ' /></td>"
str += " <td class='tdColInputCenter' style='font-weight: bolder;width:50px;' align='center'><input type='button' style='background:url(../../../images/Button/Button_Change.jpg); width:55px; Height:30px;' onclick =\"AllUpdate('JZZYBF')\" id='JZZYBF' /></td>" str += " </tr> ";
str += "</table>";
return str;
} function TableYX()
{
var str = "<table name='tblSlt' width='100%' border='0' runat='server' align='center' cellpadding='0' cellspacing='1' bgcolor='#999999'>";
str += " <tbody><tr>"; str += " <td class='ListTitle' style='font-weight: bolder;width:50px;' background='../../../images/Main/tableTitle_bg.jpg'>项目名称</td>";
str += " <td class='ListTitle' style='font-weight: bolder;width:50px;' background='../../../images/Main/tableTitle_bg.jpg'>原工资</td>";
str += " <td class='ListTitle' style='font-weight: bolder;width:50px;' background='../../../images/Main/tableTitle_bg.jpg'>修改后工资</td>";
str += " <td class='ListTitle' style='font-weight: bolder;width:50px;' background='../../../images/Main/tableTitle_bg.jpg'></td>"; str += " </tr></tbody>";
str += " <tr>";
str += " <td class='tdColInputCenter' style='font-weight: bolder;width:50px;'><select id='SltId' name='SltName' style='width:100%;'>" +
" <option value='0' selected='selected'>请选择</option> <option value='JBGZ_'>工资</option> <option value='BLGZ_'>保留工资</option> " +
" <option value='JiangJ_'>奖金</option> <option value='JZZYBF_'>加、值、中夜班费</option> <option value='DTF_'>独贴</option> " +
"<option value='MTF_'>民贴</option> <option value='FTF_'>饭贴</option> <option value='CTF_'>车贴</option> " +
"<option value='QTY_'>其他一</option> <option value='QTE_'>其他二</option> <option value='KCBJ_'>扣病事假</option> " +
"<option value='YLJ_'>养老金</option> <option value='YBJ_'>医保金</option> <option value='SBJ_'>失保金</option>" +
" <option value='GJJ_'>公积金</option> <option value='BFGJJ_'>补充公积金</option> <option value='GHF_'>工会费</option>" +
"<option value='QT_'>其他</option> <option value='GTS_'>个调税</option> </select></td>";
str += " <td class='tdColInputCenter' style='font-weight: bolder;width:50px;'><input type='text' maxlength = '12' style='width:100%;' class='tdinput' id='inputJBGZ' /></td>"; //onchange=\"AllUpdate('JBGZ')\"
str += " <td class='tdColInputCenter' style='font-weight: bolder;width:50px;'><input type='text' maxlength = '12' style='width:100%;' class='tdinput' id='inputJiangJ' /></td>" //onchange=\"AllUpdate('JiangJ')\"
str += " <td class='tdColInputCenter' style='font-weight: bolder;width:50px;' align='center'><input type='button' style='background:url(../../../images/Button/Button_Change.jpg); width:55px; Height:30px;' onclick =\"AllUpdate('JZZYBF')\" id='JZZYBF' /></td>"; str += " </tr> ";
str += "</table>";
return str;
} function TablePY() {
var str = "<table name='tblSlt' width='100%' border='0' runat='server' align='center' cellpadding='0' cellspacing='1' bgcolor='#999999'>";
str += " <tbody><tr>"; str += " <td class='ListTitle' style='font-weight: bolder;width:50px;' background='../../../images/Main/tableTitle_bg.jpg'>项目名称</td>";
str += " <td class='ListTitle' style='font-weight: bolder;width:50px;' background='../../../images/Main/tableTitle_bg.jpg'>原工资</td>";
str += " <td class='ListTitle' style='font-weight: bolder;width:50px;' background='../../../images/Main/tableTitle_bg.jpg'>修改后工资</td>";
str += " <td class='ListTitle' style='font-weight: bolder;width:50px;' background='../../../images/Main/tableTitle_bg.jpg'></td>"; str += " </tr></tbody>";
str += " <tr>";
str += " <td class='tdColInputCenter' style='font-weight: bolder;width:50px;'> " +
"<select id='SltId' name='SltName' style='width:100%;'> <option id='selected' value='0' selected='selected'>请选择</option>" +
" <option value='JBGZ_'>工资</option> <option value='JiangJ_'>奖金</option> <option value='JZZYBF_'>加、值、中夜班费</option> " +
"<option value='DTF_'>午餐费</option> <option value='MTF_'>晚餐费</option> <option value='FTF_'>夜宵费</option> " +
" <option value='QTY_'>其他</option> <option value='KCBJ_'>扣病事假</option> <option value='YLJ_'>养老金</option>" +
" <option value='YBJ_'>医保金</option> <option value='SBJ_'>失保金</option> <option value='GJJ_'>公积金</option> " +
"<option value='QT_'>其他</option> <option value='GTS_'>个调税</option> </select></td>";
str += " <td class='tdColInputCenter' style='font-weight: bolder;width:50px;'><input type='text' maxlength = '12' style='width:100%;' class='tdinput' id='inputJBGZ' /></td>";
str += " <td class='tdColInputCenter' style='font-weight: bolder;width:50px;'><input type='text' maxlength = '12' style='width:100%;' class='tdinput' id='inputJiangJ' /></td>"
str += " <td class='tdColInputCenter' style='font-weight: bolder;width:50px;' align='center'><input type='button' style='background:url(../../../images/Button/Button_Change.jpg); width:55px; Height:30px;' onclick =\"AllUpdate('JZZYBF')\" id='JZZYBF' /></td>"; str += " </tr> ";
str += "</table>";
return str;
} function aa()
{
var a = document.getElementById("cc").scrollTop;
var b = document.getElementById("cc").scrollLeft;
document.getElementById("dd").scrollTop = a;
document.getElementById("hh").scrollLeft = b;
} function AllUpdate()
{
var select = document.getElementById("SltId").value; var table = document.getElementById("tblSalaryDetail"); var CountNum = ; var NowSal = document.getElementById("inputJBGZ").value.Trim();
var ModifedSal = document.getElementById("inputJiangJ").value.Trim(); if (table != null)
{
if (select == "") //默认'请选择'的value值为'0';
{
alert("请选择你需要修改的项目!");
}
else if (NowSal == "" && ModifedSal == "") {
alert("请在对应的位置,输入原工资和修改后的工资!");
}
else if (NowSal == "") {
alert("请输入原工资!");
}
else if (ModifedSal == "") {
alert("请输入修改后的工资!");
}
else
{
//获取表格行数
var tableCount = table.rows.length; for (var row = ; row < tableCount; row++) {
var rowIndex = table.rows[row - ];
var textinput = rowIndex.getElementsByTagName("input"); for (var i = ; i < textinput.length; i++) {
if (textinput[i].value == NowSal && (textinput[i].id.indexOf(select) > -)
{
textinput[i].value = ModifedSal;
CountNum++;
}
}
CalculateTotalSalary("", row);
} if (CountNum == ) {
alert("没有找到与你要求相符的数据 ! \n 请您重新输入进行查找。");
}
}
}
else
{
alert("没有可更新的数据!");
}
}

HTML锁定Table中某一列的更多相关文章

  1. JavaScript实现获取table中某一列的值

    JavaScript实现获取table中某一列的值 1.实现源代码 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional/ ...

  2. JavaScript获取table中某一列的值的方法

    1.实现源码 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www. ...

  3. 合并table中某一列相邻的相同的行

    合并table中某一列相邻的相同的行​1. [代码]合并table中某一列相邻的相同的行  <!DOCTYPE html><html>    <head>      ...

  4. 给table中某一列的文字右对齐

    一般来说,没写过jquery的前端人员,肯定是定义一个class,给每一行的那列加上align_r{text-align:right}.这是很麻烦的. 所以用jquery来写,可以$("ta ...

  5. 关于页面中table中相同的列自动合并

    代码如下: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w ...

  6. OAF TABLE中添加序号列

    在实际的OAF页面TABLE的使用中,会有很多时候需要在前台页面中显示序号,虽然在sql中可以使用rownum来获得序号,但是rounum的优先级比order by 高,所以在语句中order by ...

  7. 如何让Table中的第一列和第二列的值相乘然后赋值给第三列

    因为需求的原因所以这样做,不废话了,直接上代码,我用的GridView绑定的数据,table也一样,因为GridView通过浏览器编译后的代码就是table.下面是aspx页面的Html代码: < ...

  8. 封装Jquery 合并table中任何同列数据

    封装代码: jQuery.fn.rowspan = function (colIdx) { //封装JQuery同列值相同合并小插件 return this.each(function () { va ...

  9. 锁定TABLE的首行和首列

    1. 2. 3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://ww ...

随机推荐

  1. Image zImage uImage

    内核编译(make)之后会生成两个文件,一个Image,一个zImage,其中Image为内核映像文件,而zImage为内核的一种映像压缩文件,Image大约为4M,而zImage不到2M. 那么uI ...

  2. CGI、FastCGI和PHP-FPM浅析

    这段时间对Nginx+PHP-FPM的概念和机制一直不太清晰,趁着同事的分享和看过的几篇博文和资料,重新将思路处理一下. 首先,PHP-FPM(FastCGI Process Manager: Fas ...

  3. 登录失败。该登录名来自不受信任的域,不能与 Windows 身份验证一起使用

    登录失败.该登录名来自不受信任的域,不能与 Windows 身份验证一起使用 使用sever sql  远程连接数据库的时候遇到了这个问题,我用的是ADO.NET 实体数据模型,有web.config ...

  4. javascript 原型详解

    引:http://www.cnblogs.com/wangfupeng1988/p/3978131.html 1.什么是javascript原型 每一个函数都有prototype属性(默认生成的)和原 ...

  5. information_schema系列之字符集校验(CHARACTER_SETS,COLLATIONS,COLLATION_CHARACTER_SET_APPLICABILITY)

    1:CHARACTER_SETS 首先看一下查询前十条的结果: root@localhost [information_schema]>select * from CHARACTER_SETS ...

  6. avalon2学习教程15指令总结

    avalon的指令在上一节已经全部介绍完毕,当然有的语焉不详,如ms-js.本节主要总结我对这方面的思考与探索. MVVM的成功很大一语分是来自于其指令,或叫绑定.让操作视图的功能交由形形式式的指令来 ...

  7. 详解log4j2(上) - 从基础到实战

    log4j2相对于log4j 1.x有了脱胎换骨的变化,其官网宣称的优势有多线程下10几倍于log4j 1.x和logback的高吞吐量.可配置的审计型日志.基于插件架构的各种灵活配置等.如果已经掌握 ...

  8. 十步图解CSS的position

    CSS的positon,我想做为一个Web制作者来说都有碰到过,但至于对其是否真正的了解呢?那我就不也说了,至少我自己并不非常的了解其内核的运行.今天在Learn CSS Positioning in ...

  9. ZZ : Ubuntu:永久修改MAC地址

    方法一: 1)编辑“/etc/init.d/rc.local”文件(sudo gedit /etc/init.d/rc.local) 2)在此配置文件的最后面加上如(Ubuntu:修改网卡的MAC地址 ...

  10. [2015hdu多校联赛补题]hdu5302 Connect the Graph

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5302 题意:给你一个无向图,它的边要么是黑色要么是白色,且图上的每个点最多与两个黑边两个白边相连.现在 ...