My daughter (almost 11 years old now) had frequent tantrums as a toddler, to the point that it was a daily occurrence which left me feeling like a failure as a mother. She would scream, hit herself and go rigid, hold her breath. She seemed to do it in crowded places too, which made me feel worse as I couldn't stop them.
Toddlers are at an age where they are frustrated because they have all these emotions and don't know how to express themselves. They are very clever, and sometimes use tantrums to get attention, or rebel when they don't get what they want.
I would ignore the bad behavior and reward good behavior. She loved visiting the local swimming pool, so as a nursery nurse, I used bribery in the form of a reward chart. If she went a day being good (I allowed for the odd wobble!) then I would reward her with a sticker, which she put on the chart. At the end of the week, if she had 5 stickers, we would go to the swimming pool on Saturday. I always would make sure that it was something positive that she could respond to e.g. activities involving baking, crafts, visits to park etc.
Time out on the "naughty" step for two minutes was successful too. I set up and ran a local playgroup at our local church, which she loved. She had the social element and loved the activities. I found that she loved to help out, by setting the table, collecting empty tumblers and helping clear away the toys.
You could try giving your child some little but achievable targets and when they complete the task, give him/her plenty of praise and a sticker. They like to be independent and do things for themselves, so letting children help is good for building confidence and self esteem. Praise and encouragement will help them to learn that positive behavior is better than negative attention.