A salary cap doesnt prevent teams from tanking. It would absolutely cap player salaries. Without a floor, the non-spending teams wont magically start spending. So all its going to do is prevent the teams who are willing to spend from spending on addtional players.
Yankees, Dodgers, Phillies ... they'll spend right up to the limit. But the Pirates, Rays, and A's still wont do crap. So then the players either have to take less money from someone else or sit out the year.
There would never be a cap without a floor