Shelves for cabinets and racks