Home  >  Article  >  Web Front-end  >  JS front-end method to merge cells in the same column of TABLE

JS front-end method to merge cells in the same column of TABLE

一个新手
一个新手Original
2017-09-13 10:22:121917browse

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;     
            }     
        }
    });
}

The above is the detailed content of JS front-end method to merge cells in the same column of TABLE. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn