table filter function now generic and applicable to all tables