[英]hide tr that has th and colspan
我正在尝试更改“ table tr”的背景,如果它具有“ colpan”并且如果包含“ th”,则在下面将无法正常工作。
$("#mytable tr").contains('th').attr('colspan').hide();
你能帮我吗?'
尝试:
$('#mytable tr').filter(
function(){
return $(this).has('th[colspan]').length;
}).hide();
JS小提琴演示 。
编辑以将.length
添加到过滤器中,因为在jQuery中发现空数组就等于找到了东西。
尝试这个。
$("#mytable th[colspan]").parent().hide()
试试这个代码:
$('th[colspan]').parents('tr').hide();
先生,您在这里:
$('#mytable> tbody> tr> th [colspan]')。hide();
这将隐藏所有个具有跨度属性从MYTABLE。
请不要忘记投票。
:)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.