For cardio, definitely after. For proper digestion, the stomach, intestines, and liver need lots of blood diverted there. When you need to send blood to your legs and arms, it compromises the digestive system's ability to properly digest food. And normally, unless you're doing hardcore endurance type stuff (e.g., marathon), your body is already plenty fueled up with glycogen to do your cardio workout without additional food.
Of course, it does depend on what you're eating. I would stay away from fat, protein, and fiber for the hour or so before the workout and consume simple sugars (e.g., juice) that are more quickly digested, if I'm having any pre-workout calories at all.
Again, I'm only speaking to cardio workouts, not weights.