It's a tough age and you should EXPECT her to not listen to you easily. Giving her choices (do you want this shirt or that one?), giving her warnings on transitions (we will be leaving/eating/going to bed/etc. in 10/5/2/1 minutes), and being SUPER consistent are vital. If you are not 100% consistent in your follow through, you are actually teaching her to continue misbehaving in order to "figure out" how she can get her way.
One thing that helped A LOT for us at that age, was a three step process. Let's say it's misbehaving at the table. For the first offence, I would start with "We do not stand/throw food/scream at the table. Please sit/put your food back on your plate/use a quiet voice." For the second offence, I would repeat that - as word for word as I could get - and add the consequence "... If you stand/throw food/scream again, you will get down from the table and dinner will be over." For the third offense, I would tell her what she did wrong and follow through, "You screamed again, so now dinner is over." When she was your daughter's age, I would give her another chance after a minute or two. One more chance, and then it was a 10 minute break from dinner. Now that she's 2.5yrs, while it rarely happens, she just gets a 10minute break from dinner, and then, depending on the situation, I may give her another chance. But I'm giving her a long enough break that she is moving on to something else and "feels like" dinner is over.
Oh yeah, and spanking isn't going to help very much here, and might just teach her to hit when she thinks you are doing something wrong.