Home > front end >  Request a great god how to hide cycle after the table tag, nasty nasty!
Request a great god how to hide cycle after the table tag, nasty nasty!

Time:09-25

Through the results after the foreach loop, if the whole column of 0 to hide the column, the column with a 0, then the column shows, how to operate? If a a td to judge, will become is not zero cell, 0 is hidden, will not keep the whole column

CodePudding user response:

?????

CodePudding user response:

Loop a judgment, to hide cycle again processing:
 var flag=true; 
Var rows=$(' # someid> Tbody> Tr ');
for(var i=0; iVar td=$(rows [I]), find (' td: eq (6));
If (td. The text ()!=='0') {
flag=false; break;
}
};

If (flag) {
For (var I=0; i $(rows [I]). The find (' td: eq (6)). Hide ();
};
}

CodePudding user response:

Hello World reference 2 floor, response:
cycle a judgment, to hide another cycle processing:
 var flag=true; 
Var rows=$(' # someid> Tbody> Tr ');
for(var i=0; iVar td=$(rows [I]), find (' td: eq (6));
If (td. The text ()!=='0') {
flag=false; break;
}
};

If (flag) {
For (var I=0; i $(rows [I]). The find (' td: eq (6)). Hide ();
};
}
if no success
  • Related