jquery - Remove next row cell if rowspan is found -
i have loop through table in every tr if td have csstdgreen , have attribute rowspan. have remove cell have text remove me.
function cleartable() { if ($("tr").has("td.csstdgreen").length > 0) { if ($('td[rowspan]') == 1 || $('td[rowspan]') == 2 || $('td[rowspan]') == 3) { var $this = $(this); var = $this.index(); } } }
$('table tr').each(function(){ var indexofthis,indexofcolspan,numrows; if($('td[rowspan]',this).length!=0) { indexofthis =$('table tr').index(this); indexofcolspan = $('td',this).index($('td[rowspan]',this)); numrows = $('td[rowspan]',this).attr('rowspan'); $('table tr:gt('+indexofthis+')').each(function(){ $('td:eq('+indexofcolspan+')',this).remove(); }); } }); รข
this should give helping hand need. js fiddle not working me atm. there little tinkering not number of rows, whole grid. main part done.
Comments
Post a Comment