就對所有的tr做檢查,然後裡面的td去查值,如果是未婚女性,就顯示,其他用hide就行了。
var trs = $('table>tbody>tr')
function filter_for_table(){
    trs.each(function(){
        var checker = true;
        $(this).find('td').each(function(){
            if ($(this).text() == "男" || $(this).text() == "已婚"){
                checker = false;
            }
        });
        if (!checker){
            $(this).hide();
        }
    });
}
function restore(){
    trs.each(function(){
        $(this).show();
    });
}