JS前端合并TABLE相同列的单元格的方法

一个新手
一个新手 原创
2017-09-13 10:22:12 1428浏览
function _w_table_rowspan(_w_table_id,_w_table_colnum){
    _w_table_firsttd = "";     
    _w_table_currenttd = "";     
    _w_table_SpanNum = 0;     
    _w_table_Obj = $(_w_table_id + " tr td:nth-child(" + _w_table_colnum + ")");     
    _w_table_Obj.each(function(i){     
        if(i==0){     
            _w_table_firsttd = $(this);     
            _w_table_SpanNum = 1;     
        }else{     
            _w_table_currenttd = $(this);  
            if(_w_table_firsttd.parent().attr("invoiceNumber") ==_w_table_currenttd.parent().attr("invoiceNumber")){     
                _w_table_SpanNum++;
                $(_w_table_currenttd).attr("disable", "true");
                _w_table_currenttd.hide(); //remove();     
                _w_table_firsttd.attr("rowSpan",_w_table_SpanNum);     
            }else{     
                _w_table_firsttd = $(this);     
                _w_table_SpanNum = 1;     
            }     
        }
    });
}

以上就是JS前端合并TABLE相同列的单元格的方法的详细内容,更多请关注php中文网其它相关文章!

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。