UGH! These shelves can be such a pain, especially when they are in your pantry. Cereal boxes tip over, cans sit uneven, things don't slide easily....etc.
I would love nothing more than to have my closets and pantry with the wooden shelves, but unfortunately, our house didn't come with those! :( Neither did our first house, but we found a solution.
Self-adhesive vinyl floor tiles. No particular brand, just whatever is the cheapest. I, personally, like the self-adhesive, but they don't have to stick. This box was only $12 at Family Dollar and we were able to do our entire pantry, and 2 shelves in our laundry room. So easy. Just peel and stick. You may have to do a little measuring or cutting, but it's worth it.
The end result. Everything sits evenly on the shelf. No tipping over and so much more easy to organize.
And, by the way, HAPPY VALENTINE'S DAY!