对于“y”类的每个表,如果表不包含“x”类的后代,则选择降序的 th 和 td 元素,然后删除它们的宽度属性。
这是我到目前为止所拥有的:
$(document).ready(function(){
$('table.y').has(':not(.x)').find('td').removeAttr('width')
$('table.y').has(':not(.x)').find('th').removeAttr('width')
});
对于“y”类的每个表,如果表不包含“x”类的后代,则选择降序的 th 和 td 元素,然后删除它们的宽度属性。
这是我到目前为止所拥有的:
$(document).ready(function(){
$('table.y').has(':not(.x)').find('td').removeAttr('width')
$('table.y').has(':not(.x)').find('th').removeAttr('width')
});